some OCD refactoring and test cleanup.
Merge pull request #20 from dnephin/random_minor_cleanup

some OCD refactoring and test cleanup.