`.getCurrentState()` & `.setSingleSelectionRange()`

This is for #512.

It should return an object that contains the output of `rawHtml()` and perhaps the selection.
I've already made some progress on this on a different branch so I'll merge this as is. Can you explain the preference, please?