Support Library.Max in QueryInterpreter.

Requires a better implementation of aggregates that does away with the
initial value.

Test in AggregateTest.testGroupby. Fixes issue #512.

Review by @cvogt