Major rewrite to use ZMQ