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).

https://d.puremagic.com/issues/show_bug.cgi?id=9616