Finish implementing codemirror events