Problem: selftest leaked memory when networking was off

The selftest exits when it can't create a beacon; it didn't destroy
the context and so leaked memory. Fixed.
Problem: unnecessary delays in zauth selftest

Solution: reduced failure delay from 1,000 msec to 200 msec.
Reordered methods for better clarity
Problem: zhash_foreach() is clumsy and horrible

Callbacks are nasty, and I much prefer using the zlist first/next
style iterators, so I've added this to zhash and it works nicely.

Solution: use simple iterator API as learned from zlist, so caller
can get items from hash table in some arbitrary order.

Difficulty: we need to provide both key and value, so the methods
return the value, and a helper method (zhash_cursor) to return
the key.
Removed dangling debug output
Problem: 'service' is overloaded in zgossip

Solution: abstract the gossip model away from service discovery
(implemented as services), to a more general tuple gossip model.
In this, services exchange name-value tuples, that can be used
for discovery, configuration data, etc. This makes it much easier
to understand. The gossip protocol operates independently of the
data it is carrying.

Also, now sends tuples to new remote server upon connection.
Merge pull request #513 from hintjens/master

More changes for zgossip and other improvements