Dashboard template cleanup

Move JavaScript from dashboard template into its own module
Make HTML comments Mako comments

This reduced the size of the rendered template from 25KB to 20KB (20% decrease in size).

I tested:
* Notification focus
* Upgrade to verified messaging, including analytics events
* Verification failure notification
* Email settings
* Unenroll
* Password reset
* Change language
* Change email
* Translation strings are being properly extracted.

@dianakhuang @AlasdairSwan please review.

[ECOM-448](https://openedx.atlassian.net/browse/ECOM-448)
Due to JavaScript hoisting the variables should be declared in the first line of a function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var