Begin rewrite of text-selection handling