Add new file added by inolen's patch.
Add initial CMakeLists.txt build.
Fix CMake build on OSX.