Fix for MSVC and move stuff around a bit in CMakeLists.txt and src/CMakeLists.txt