Updated with combiner function and a generic reduce function which could emit more than one value for a key