Cleaned up map/reduce js.

Thanks Alex (for pointing out how dumb it was!)