Simple self-contained illustration of MapReduce in JavaScript