Readd CodeMirror search/replace functionality

I implemented this in ff017ffa09 but it seems to have been reverted.