3.x: merged gar1t's fork

merged gar1t's fork into 3.x and fixed tests

zguide erlang examples use erlzmq_device (e.g. in msgqueue.es) which was only available on gar1t's fork. I merged it in branch 3.x and adapted the tests. I request to pull my commits into 3.x to make life easier for erlang-zguide-readers.