map-reduce and separately js generators