added reduce method to NSArray and NSSet

Return a single value from an array by iterating through the elements
and transforming a running total.