Build pk3 with CMake + fix test scripts for OSX