Aggregations support in the native client

Fixes #100, still WIP.