Add method 'reduce' to apply a function against an accumulator and each value of the array as to reduce it to a single value.