Replacing getCode with getValue and simlarly for setCode for codemirror editor.