Remove all dependency on the browser window's selection

Note, this currently breaks mouse-selection in IE entirely.
Batch up multiple calls to redraw selection region

This does not need to be done immediately after every operation.
Add IE compatible caretPositionFromPoint implementation

Internet explorer still has no equivalent for
document.caretPositionFromPoint. This patch provides a manual impl that
uses client rectangles to attempt to simulate similar selection
behaviour.