Fix issue 5968

Added a real groupBy facility. Making it single-pass was interesting.
Giten a forward range $(D r), this returns a range.