Various fixes to paragraph and range selection

Primarily re-implementation with step iterators + additional tests  and bug fixes.