Fixes #121. Implementation of an groupBy for iterators concept.

Take a look at this and see if anyone has a problem with this.