transports: refactored transports to handle batching, will make other clients like zmq easier to implement