Refactor heavy manual DOM manipulation into directives/templates/controllers

Many apps have JS files that generate & manage complex DOM elements (such as popups/dialogs, settings, and button handling) that aren't plugged in to the Angular system. For example, all of the Experiments app's JS files manipulate the DOM.

A few issues that suggest we refactor this:

  • No separation between the HTML & JS
  • No separation between background processing/AJAX & DOM manipulation
  • No clear patterns for extending/changing/reusing these DOM manipulations (no modularity)
  • Very little comments/documentation

Angular Directives were designed to manage these heavy DOM manipulations.