Add bytecode generation of serializer for accumulator state
Allow state types to provide their own serializer and state factory
Simplify implementation of aggregation functions

Change AbstractAggregationFunction use to generated state serializer for
serializing intermediates to the wire, and by default for serializing
them in evaluateFinal() (only if the state is a single primitive).

Aggregation functions now optionally implement combineState() to merge
their intermediate state objects, and evaluateFinal() if they need to do
something more than just serializing the current state.
Introduce base class for approximate aggregations

Rewrite approximate AVG to use the new base class
Convert approximate COUNT to new aggregation base class
Convert approximate SUM to new aggregation base class
Remove BlockCursor from new aggregation base classes