cmake: Reorganize macros, and cleanup related files (add docs, etc)