Refactor stuff into modules using requirejs