Add templates; clean up controllers.
Major refactoring complete.