Optimizing script and style loads

Most of this is a copy from
https://github.com/zgreen/MITlibraries-parent/commit/b9d77fe1ef1094782e9
29315e3129db45b9149b8
Merge branch 'js-css-html-optim' into prod