Moved more stuff into packages and refactored chained methods into
classes.
Some cleanup and made some methods private in preparation of writing
tests.