Add ace template, add template/undo/redo buttons

This commit moves the ace html code into a template to render by the
form erb. It also adds a few functional buttons for generating
templates, and operating the undo and redo stack for the editor.