Wrap redundant reduce and reduceRight code in helper

The loops could be further abstracted, but I didn't like how it looked after going that far

Fixes #1734 
Yes but exiting the loop is  ugly
On Dec 28, 2014 8:59 PM, "Michael Ficarra" <notifications@github.com> wrote:

> In underscore.js
> <https://github.com/jashkenas/underscore/pull/1991#discussion-diff-22301764>
> :
>
> >        memo = iteratee(memo, obj[currentKey], currentKey, obj);
> >      }
> >      return memo;
> > -  };
> > +  }, 1);
>
> If you're passing in dir, can't wrapReduce subsume the loop as well?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jashkenas/underscore/pull/1991/files#r22301764>.
>