Adding lots of comments, as well as reworking where some things live.