function pathJoin(paths) {
  var slashes = new RegExp('/{1,}', 'g');
  return paths.join('/').replace(slashes, '/');
}
Combines path parts together, without duplicating separators (slashes).  Used instead of `path.join`
because this code runs in the browser.

@param paths array of paths to join together.
@returns joined path string, with single '/' between parts