Isolate platform-specific code and add Windows versions