Using CMake to build  things

In order to get this working on OS X and subsequently adding it to the homebrew software repo.