Switch to new CodeMirror.Doc system and observe content changes.
Only update Doc contents if nothing has changed.