Moves variable for clarity.
Factors spawnMapWorker out to avoid creating functions.
Adds reduce implementation and test.