Major debugging and code cleanup (thanks to some nice improvements in the czmq-ffi API).