[js] Switching to a somewhat sensical requirejs loading pattern. Still a work in progress, but I am trying to grok the dependency graph