Move CMakeLists.txt to the top level, per usual CMake convention

This just moves the file around to the usual space and then fixes up all the paths that change.

In a few places, there's a tiny bit of other minor movement of code in the files, but no real changes.