Vs2012

These are several of the changes I made to build under Visual Studio 2012.

I believe Yangyan Li already fixed the thrust::tuple and make_pair bugs in trunk, but the CMake changes may still be useful.