Feedback from code review

Fixed up placement of some functions, added docstrings, and made the test
data better.