Move towards new api.
Move towards new api.

This in progress code is so ugly.
I am commiting it for prosperity,
and the people who do rebase before merges.

dominictarr/map-reduce,allain/map-reduce,substack/map-reduce