widget: Rewrite the tracking of selection endpoints

Track mouse click and drag positions as pointing to the left or right half
of a character cell, rather than between cells. This change is required for
forthcoming BiDi support.
Refactor the methods and their responsibilities.
Fixes and improvements of corner cases as listed in the bugreport.
#34