DEVELOPER-899 optimise JS load order

* start splitting up scripts.js in to finer 
  grained modules
* start documenting 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
Merge pull request #452 from pmuir/DEVELOPER-899

DEVELOPER-899 optimise JS load order