Better aggregation support

Added support and tests for aggregation operations.
Small code duplication here, could maybe haul out the message.body().getArray("pipelines") call