[NEWSPLT-106] Fix templates when usePortalJsLibs = true.  Bonus: easier ...

...templating.

https://issues.jasig.org/browse/NEWSPLT-106