Gen functions

Can you give this a once over, i remember the last time I made some pretty silly mistakes.
http://caniuse.com/#search=reduce Guess it depends on how far back you want to support ie, and I guess opera mini.

I was just being lazy here. I can redo it as a loop, or write it with an accumulator so tco gets hit.