url_path_split = function (path) {
        /**
         * Like os.path.split for URLs.
         * Always returns two strings, the directory path and the base filename
         */

        var idx = path.lastIndexOf('/');
        if (idx === -1) {
            return ['', path];
        } else {
            return [path.slice(0, idx), path.slice(idx + 1)];
        }
    }
join a sequence of url components with '/'