Add wfRemoveDotSegments and unit tests. This is a sane step towards fixing