Syntactic cleanup

r?

These changes should all be semantics-preserving. Got rid of a few structural records, moved a few functions into codemap that really belonged there.  No changes to crate structure.