User defined aggregates

Review after #594 

@domoritz , you are probably the best reviewer if you have time. UserDefinedAggregator is essentially a fork of StatefulApply, except that the emitters only trigger at EOS and the emitters are not allowed to use the input tuples.
AFAICT if you're doing a sum of sums, this means they're necessarily in two separate operators.  (If inside the same operator, you could combine them.)

In that case, the optimizer and/or compiler DEFINITELY has to introduce them. E.g., raco usually puts them on separate sides of a network broadcast.