General cleanup

I got this far before my patience wore out.
Merge pull request #125 from bugsduggan/cleanup

General cleanup