Problem: list and hash container APIs are messed up

There are a lot of good ideas in the new API yet the results are a
mishmash of old and new, without a clear route to a nice clean API.
The zring class was an attempt to fix this, yet it made things more
complex, not simpler.

I'm going to do this in stages:

* Deprecate the v2 classes, using the same names. This does not
  break existing applications. I'll remove some of the new messy
  code from these classes in a second step.

* Create new classes called zlistx and zhashx which initially look
  just like the old ones. I'll clean these up separately.
Problem: zmsg_popint is not useful (any more)

The usecase I had for this has gone and it's unclear it serves any
purpose. It adds clutter to the API for no benefit.

Solution: remove it.
Problem: still using zlist internally in CZMQ

Solution: leave zlist_t in public API where it's used (e.g. in
zdir and zconfig. Internally, switch all use of zlist to zlistx
except in deprecated classes. Also, switch to zlistx in public
API for zhashx_keys.
Merge pull request #805 from hintjens/master

Problem: list and hash container APIs are messed up
Problem: zlist_sort is broken

Solution: fix it, this code seems to have at least two major errors
in the design, as well as being more complex than necessary. Yay
test cases!
Problem: zlistx is too slow

Solution: implemented double-linked list from zring, with a cleaner
API and full test cases. Fixed all use of zlistx in CZMQ classes.
Problem: if zsock_destroy_ is used, does not clean sockref

This is a problem for zgossip, which uses zsock_destroy_ to clean
up its remotes table.

Solution: no need to guard removal loop with filename.
Problem: getting ZMQ_TYPE isn't stable at shutdown

Solution: store zsock type in object, and change zsock_type_str
method to take a zsock_t * rather than a void *.
Problem: double-free of message (harmless)

Solution: regenerate from zproto codec
Problem: zlistx_next is unsafe after zlistx_detach

Solution: reset cursor after any list modification (add, detach).
Problem: whitespace looks wrong - fixed
Problem: deleting items is too slow

Solution: work with item handles

- add methods return an item handle, rather than 0/-1
- find method returns an item handle
- delete method takes an item handle
- fixed all classes that use zlistx
Updated man pages
Problem: node insert/delete code is clumsy

In fact a doubly-linked list is easy to work with if you always initialize
a new node to point to itself. Then, inserting and removing a node is the
same operation (swap pointers with prev/next nodes). As we're doing this in
a few places, and it's the most tricky area of such code, it's worth doing
right.

Solution: do it right using a s_node_relink method.

Problem #2: inner loop check on self->comparator is clumsy and unnecessary.

Solution: define a default comparator so this test can disappear.
Fixed whitespace weirdness from restyling
Problem: need methods to move items to start/end

This is necessary for timers, which I'm improving in zproto/server.

Solution: zlistx_move_end/zlistx_move_start methods with optional
"move into place" sorting.

Incidentally, fixed major bug in sort algorithm. Lesson here is
"do not trust Wikipedia" (the bug was copied from a deliberate(?)
error introduced into the combsort pseudocode).
Merge pull request #806 from hintjens/master

Redesigning zlistx API
Problem: src/zloop.c:287: assertion failure

zloop_destroy: Assertion `zlistx_size (self->zombies) == 0' failed.

Caused by creating / destroying a timer without actually starting
the reactor. The reactor only cleans up the zombie list when it's
running.

Solution: clean up the zombie list in the destructor, in any case.
Problem: code contains __WINDOWS__

Solution: fix to make work without platform dependencies.
Problem: move methods cause list corruption

If the node is already at the start or end, then move drops it off
the list completely.

Solution: don't move node if it's already in the right place.