Windows build

Changes to the build to allow compilation under Windows, and to remove ordering sensitivity in tests that break under different VMs