batching and atomic queues
Major rewrite with GCD and cleanup.