Fix issues with path joining on Windows.

path.resolve on Windows prefixes everything with <drive>:\, and uses
backslashes for directory separaters. This now uses string concatenation
and a regex to remove double leading slashes. It's a bit hacky at the
moment, but will be cleaned up in the future.