zmq code ported to 3.x; shims for 2.2. Fixes #3