changed map reduce from using array reduce to foreach.

foreach is the lame way of doing it but reduce was only working sometimes.
whatever
Merge pull request #19 from paulgrock/mapReduce

changed map reduce from using array reduce to foreach.