Added testing and comments and some minor changes for the new batching code. Also made the bytes-sent and bytes-received metrics a Histogram rather than a simple counter.