Much, much better cmake

No desire to merge just yet; please review @baka-rust