Fixed Random Bugs

Fixed a few bugs, isolated the framework, and cleaned up and fixed a few
modules.