WIP: Aggregates

I still need to add tests, so this code isn't quite ready to merge, but all the functionality should be there...
Yeah, there's some custom stuff going on... For example, the StatsAggregateResult JSON has all of its values inside of a "statistics" object, which makes sense in the JSON, but in Java code, I prefer not to wrap those values in their own separate class. There are a few other things like that... Nothing major, but that's why I hand-coded the (de)serialization.