Correct selection after multi edit

This is a complexity monster but it comes with tests. And I like complexity monsters that come with tests. ;)

The changed method `applyMultiTextEdit` should preserve the selection after changes are applied to a document. This worked fine so far but with the upcoming save actions/auto edits we need a more powerful implementation.

For example the logic needs to detect if a change happens inside of a selected region or if changes happen before and after the cursor position at the same time. With our current refactorings, completions and other features that use this method, we don't have a need for such use cases, therefore they didn't work.

Because save actions/auto edits are not yet merged, the changes by this PR shouldn't have any effect to the current behavior of the IDE. I'm opening this as a separate PR nevertheless, in order to not make my other PRs more complex than needed.
This seems to be a common operation, it would be nice to have a `RichTextSelection` implicit class. I can see it being useful below as well.