Refactored common iteration utilities from array/each and object/each.
Fixed a bug in object/each.
Refactored common reduction utilities from array/reduce and object/reduce.