function canonicalizeUrl(url) {
    var parts = split(url);
    return joinAndCanonicalizePath(parts);
  }
Canonicalizes a URL by eliminating ./ path entries,
canonicalizing ../ entries, and collapsing occurrences of //.

@param {string} url
@return {string}