Fix path-handling on Windows

This has the same goal as #47, with a different approach.  I'm not sure yet which is better.

I'm making this PR to make it easier to compare the results of both approaches directly.