Refactored everything into factories, controllers and directives in seperate files and directories