Various fixes to hyperlink editing

Fixes the current hyperlink editing issues. This is a replacement patch for pr #654.

Key changes in this patch

* Add & edit hyperlinks now result in the user's selection being set to the modified hyperlink. This helps provide visual clarity about what has been included in the hyperlink, and tends to match most commercial editors
* Performance improvement by delaying the fetching of display text until the edit hyperlink pane is shown. This is especially noticeable with the pending changes in pr #605
* Editing a hyperlink with a collapsed selection now updates the surrounding link (#490)
* Fixed assertions when editing a partially selected hyperlink (#650)