Improve building on Windows.

In theory now supports MSVC 2010, 2012 and 2013.