Refactoring

Just cleaning up a little bit. The only major change here is using
properly cased names in the type definitions. Everything else is just
rearranged.
Merge pull request #45 from zendesk/samshull/refactor

Refactoring