Simple lua mapreduce implementation