Support array reductions: min/max(), arg min/max() sum()/mean()/var()/std()

Related to issue #828 and some others.