normalizeAndRelativize

fun Path.normalizeAndRelativize(): Path

Remove all redundant . and .. path elements. Leading .. are also considered redundant.