Refactored CTC and added some things to various other modules. Also, a
bunch of TODOs that need to be filled in.