Use CodeMirror's batch api
Event tracking