Zmq32 compatibility

I made a number of changes to support running with zmq 3.2.

I also fixed tests which were failing for me.

Can you please review and merge?

BTW, I suggest to get rid of the map_sockopt thingy.

It's a pain to support and not needed anymore.

What do you think?