Major refactor. Using a single controller for the menu and object literals as modules for other functions