Added CMake files for painless cross-platform development.
Build fixes for MSVC.