Windows / Visual Studio 2012 fixes

Enable building and testing on Windows 7 with Visual Studio 2012