Refactoring!

Major points:

* Increased code coverage, particular for various types of comments.
* Cleaned up stray lines that were being outputted around comments.
* Added and updated a lot of the comments.