Initial refactoring.

Moved from individual modules to a central module with subclasses (in
progress). Cleaned up all code encountered so far to meet puppet style
best practices whenever possible. More to come.