Slowly start to port EHTMLEditorView and EHTMLEditorSelection

Also simplify how the dialogs are working with DOM.