MSVS 2013

A whole bunch of changes which try to support MSVS 2013 update 3 and its
broken C++11 support.

Some support for MSVS 2012 might sneak in by accident.