Fix wrongly enabled hyperlink tools with no document loaded
Remove duplicated code, linksInSelection is set later again
Merge pull request #833 from kossebau/fixEnabledHyperlinkToolsWithoutDoc

Fix wrongly enabled hyperlink tools without a document loaded
Add test showing position stability issue near annotations
Add additional tests showing position stability problems
Fix position instability around highlighted annotations

By checking only nodes that pass the supplied node filter, the position
logic can safely ignore out-of-place cursors near highlighted annotations.

Note, this can't re-use PositionIterator.previousNode, because the logic
requires the previous sibling of the current container's previous sibling.