Rewrite create new template action. Add template for Javascript.
Improve error reporting in the editor.