Fix top level import on Windows
Fix popen spawn and tests on windows