Fixes to getRelativeOffset and getRelativeRange

Major refactor of getRelativeOffset/getRelativeRange functions.

* Skip over nested handlesOwnChildren nodes in getRelativeOffset by
  tracking depth instead of a boolean (as we do in ve.dm.Transaction).
* Ensure we never move backwards in getRelativeOffset (bug 67551)
* Fix behaviour around collapsing ranges with arrow keys
* Add many more test cases

Bug: 67551
Bug: 66604
Change-Id: Ic2da78b86e13cd51af058d884048d9549fc55abc
Merge "Fixes to getRelativeOffset and getRelativeRange"