Fix Issue 9616 - SortedRange should support all range kinds

This is the first installment of a larger idea that includes LINQ-style stuff (joins, merges and such).