Another batch of work towards tighther cc-mode integration

Status update on #66: this branch should be functionally equivalent to master and I am not aware of any remaining bugs.