code: function (path) {
                  //There has to be an easier way to do this.
                  var i, part, ary,
                      firstChar = path.charAt(0);
  
                  if (firstChar !== '/' &&
                          firstChar !== '\\' &&
                          path.indexOf(':') === -1) {
                      //A relative path. Use the current working directory.
                      path = xpcUtil.cwd() + '/' + path;
                  }
  
                  ary = path.replace(/\\/g, '/').split('/');
  
                  for (i = 0; i < ary.length; i += 1) {
                      part = ary[i];
                      if (part === '.') {
                          ary.splice(i, 1);
                          i -= 1;
                      } else if (part === '..') {
                          ary.splice(i - 1, 2);
                          i -= 2;
                      }
                  }
                  return ary.join('/');
              }
docs: Remove . and .. from paths, normalize on front slashes