Massive overhaul to CMakeLists.txt

Okay, not massive, but pretty big anyways