Updated and fixed MSVC support. Support Visual Studio 12 (2013 Preview).

Lach,

I updated the MSVC support for VS2013. It's mostly trivial, as not much has changed since this was done about a year ago. The only major thing is that you had started to use some C++/C99 features which MSVC sadly doesn't support yet, so to be pragmatic I just removed the usages. It makes the code a bit uglier, but hopefully you agree it isn't too bad.

--ajs.