Solves issue #17. Cleanup of unused imports and data structures in some modules