Almost got the template editor working reasonably
Using CKEditor for the editor, sigh.