Improved and fixed normalizePathElements
Added tests
Improved normalize merhtod