Support cursors in ace

This is the minmal amount of work I had to do to get different
color cursors appearing in ace. It involved:

- creating functions to convert ace ranges to cursors and vice versa
- reaching into the ace internals to render cursors
- emitting cursor events from the server to opened docs
- add a couple cursor tests

Let me know if there's anything I can do to help get the cursors branch into master.