basic mapreduce with unit tests