Handle Windows-style paths.

Hi,

I ran into trouble on Windows and found that the `logical_path` was evaluating to odd values because of the different path separator.

This change replaces the backslash with slashes when converting the file system path to logical path.

I've added tests for these cases (where possible) - this only changes the path on Windows, Unix-style paths aren't affected.