Refactoring CMS. Waypoint #267. #268.
Cleaning up CMS. Waypoint.
Finish refactoring CMS javascript. Closes #268.