Port to Windows

Minimal changes were made to the code to get it to run on Windows 2012