Unit tests for RemoteFunctions DOMEditHandler

@dangoor 

* Refactored in-browser edit handling to DOMEditHandler
* Fixed bug in `textReplace` when target text node is the last sibling preceded by comment nodes

TODO fix issues with implicit open tags