use pairwise summation for sum, cumsum, and cumprod
use pairwise summation for mean, var, varm; also fix bug in var for complex arrays (should use absolute value and return a real number)
use pairwise reduction for sum(f, A) and prod(f, A) via new (non-exported) mapreduce_associative
Merge pull request #4039 from stevengj/pairwise

RFC: use pairwise summation for sum, cumsum, and cumprod