Generator refactor

Implemented all of the reducers using the nested generator pattern in map_reduce_utils

added a parameter to specify the precision of  results
might be better abstraction if the reducer_stream() returns two things: key and a key_stream. Then the key_stream can yield only values instead of the same key every time.