Use forward iteration on selections, and take advantage of it when updating

SelectionList::update now is optimized for the common case where changes
are sorted, the algorithm is O(m*n) with m the number of sorted ranges
in the changes. In the common case, m should be very small.
update TODO
remove reverse iterator from SelectionList