Cleanup unused variables and imports
Completed splitting into modules
Fix undefined references
A few missing things from modules.  Send to repository