Refactor build scripts and add Win32 target