Fixed trimDots() for paths that contain ".." in the middle

trimDot() does not remove ".." in the middle of the path array:

pathSegments = ["a", "b", "..", "d"];
trimDot(pathSegments);

Expected:
["a", "d"]
Actual:
["a", "b", "..", "d"]

This commit fixes this problem.

This issue occures in AMD-modules generated with the TypeScript compiler when referencing other modules by relative paths.