Extracting a text cursor class

The logic for painting a text cursor is only loosely related to the main text
block painting routine, so I've pulled it out for easier reading and testing.

This class deals with the fact that we have up to two separate layouts, picks
the right one and then positions the cursor for painting appropriately.
WIP: Wire in the cursor