Selection API fixes

I've just found this bug in `.canSetCaretBefore` and fixed it and it exposed failing tests. In essence, some assertions were dependent upon `.canSetCaretBefore` to return true for them to be called.

Now that I've fixed `.canSetCaretBefore` to return true in more cases where it should then some more assertions are running and they are failing. In this branch, I will fix them.