Use Compiler API in Loader.

Now our command line always runs through our Compiler API.

Fixes #1324
uniqueSegments is O(n)

Not a big deal though.

Maybe?

var segments = [];
while (dotDotSegments--) {
  segments.push('..');
}
segments.push(...uniqueSegments);
return segments.join('/');