CMAKEified: Added CMakeLists. Also added comments to help myself understand the code