Preserve undo stack in editor on resetting contents from externally modified file

TBR

The old code used to use a badly "fixed" version of `EditSession.setValue` in Ace JS (see https://groups.google.com/forum/#!topic/ace-discuss/yICeCYR5oXU): that version reset the undo/redo stack, so going back to the original text was impossible.

Also turned on selection of the range of an undo or redo operation when it's performed (for reference, this is how Dart Editor behaves).