Refactoring modules

Tabs now in a module pattern.