Simple MapReduce implementation, written in JavaScript