CMake modularisation

First steps into proper CMakefile modularisation. I didn't change any functionality, just refactored into a more CMake-ish way. Compiles fine using Ubuntu, but I don't have OSX and Win images set up (yet), so I couldn't test there. Please test once with OSX.

Please also add my github account to the project. Thanks!