Add property tester for text selections

The `nonEmpty` test on a text selection checks whether something is
selected in an editor. This is used in refactoring handlers in order
to disable them when they can't be applied.