Move logic for retrieving the caret rect into a common area and share with SelectionView

SelectionMover's caret client rect logic is a more robust version of the
getCollapsedRectOfTextRange function in SelectionView. The intended
behaviour is identical, but SelectionMover's version contains many more
unit tests and is able to cope with invisible or collapsed text elements
regardless of where they appear in the document.