lots of requirejs refactoring.