Now uses CMake to generate build files. Also fixed windows build isses.