Tidyup SelectionController

Extracting some concepts out for re-use in the line-wrap detection rewrite.