Add class collection_buffer.

The collection_buffer class uses a internal thread to aggregates
its buffer concurrently. the parameters 'limit' and 'max_size'
sets the limit of resources to aggregate at one and the maximum
size of the buffer.