fix types based on tests
fix tests and optional argument for reduce functions
Merge branch 'lodash-refactor' into docmunch2