Add support for grouped map reduce, fixes #23