Add some tests and support for BatchingQueue