Make tests portable to Windows

This PR makes the full test suite run on Windows, with the exception of one test that must be skipped because it uses *nix-specific functionality.