+1. [RequireJS](http://requirejs.org/)? Or more simply starting with at least external files?