Mapreduce toArray and toJson implemented