Refactored TextEditor and still incomplete CodeMirror support.  Fixes for GHC 7.8.