DEVELOPER-899 optimise JS load order

* split up scripts.js in to finer grained modules
* document dependencies of each module
* move AJAX calls before DOM ready event
* move polyfiller to the beginning of the scripts
  to allow it max time to load