cmake-work

Initial splitting up and cleanup of CMake code (looking for feedback for now; merging would be best held off until the other directories have the same treatment). I'll add comments inline as to where some things need attention yet.
Excuse the absolute ignorance, but why is there an exception for connectivity tool? If there's no specific reason, then we may as well just rename it from CONN_TOOL to CONNECTIVITY_TOOL to stick to the rule. connectivity_tool isn't a required binary, and ordinary users will never touch it, so we can pretty much do whatever we need to it;)