Change path.join to url.resolve for cross-platform compatibility

Because `path.join` is intended for filesystem paths and not URLs, baucis works on, say, *nix but fails on Windows, where the filesystem separator is a backslash. I replaced all of the occurrences of `path.join` with `url.resolve` and ensured that `basePath` always has a trailing slash, to account for the difference in function behavior.