defining MapReduce in terms of Iterable (vs Iterator) gives access to groupBy, meaning that the toList can be avoided