Split your application logic in AMD, like RequireJS or AngularJS