First attempt at cleaning up source.
Second attempt at cleaning up source.
Merge pull request #592 from DouweM/cleanup

Clean up source.