CMake migration

This removes the original Makefiles and adds CMakeLists files.

Reasons for doing this:

* Allows for easier building on other platforms (for example, this works on OSX now)
* Makes the code more modular
* It is now possible to build a static library
* Adds support for building in a dir other than the main project dir

Note that now building static libs is now the default, but you can build shared libs by adding `-DBUILD_SHARED_LIBS` when you call cmake.

Also, as a note on the last bullet point, I personally like making a dir called build and running `cmake ..` inside that. This way, the code dir isn't full of object files and extra stuff.