rails-inspired calculations for underscore (average, sum, maximum, minimum)