Add CodeMirror for in-browser template editing and preview

All credits to: http://codemirror.net/demo/preview.html
CodeMirror integration