Manually pick changes and improvements from master to build on win32 (without specifying platform toolset)