Moved to CMake build system and made things kind of work on Windows.