added aggregateSum and aggregateBySum methods

and all the other helper mergeSum methods that were needed