Fixed directory handling for Windows.

By using path.join() function to join the URLs, the generated output was using Windows path separators.

Although this fix works, I do not believe it is optimal. In particular, the regex at the end of line 47 could be done better.