Better CMake files - works on OSX
Compiles on OSX
Minor fixes.