Add mapreduce style counting to examples