Various tweaks and additions.
Refactored and added documentation.

Moved some classes around and added some documentation.