serialize: implement Encodable for DList

This impl was missing for unknown reason.
dlist: Simplify match clauses to use Option methods

Make the core Deque implementation a bit simpler by using Option methods
when we simply map on a Some value, and deduplicate some common lines.
dlist: Factor out pop and push operations by list node

Factor out internal methods for pop/push ~Node<T>, This allows moving
nodes instead of destructuring and allocating new.

Make use of this in .merge() so that it requires no allocations when
merging two DList.
dlist: Add .rotate_to_front(), .rotate_to_back()

Add methods to move back element to front or front element to back,
without reallocating nodes.
dlist: Add bench test for rotate_to_{front, back}
dlist: Remove bench tests for vec

These tests for ~[] performance don't really belong here, they were for
comparison.
dlist: Use Ord for .insert_ordered()

We don't need TotalOrd for ordered insertion, just the normal sort order
Ord.
dlist: Remove extraneous unwrap in .pop_back_node()
dlist: Fix .peek_next() w.r.t double ended iterators

.peek_next() needs to check the element counter just like the .next()
and .next_back() iterators do.

Also clarify .insert_next() doc w.r.t double ended iteration.
dlist: Rename rotate methods to .rotate_forward() and .rotate_backward()
auto merge of #7944 : blake2-ppc/rust/dlist-move-nodes, r=bblum

Factor out internal methods to pop/push list nodes so that .merge() and .rotate_to_front(), .rotate_to_back() (new methods) can be implemented without allocating nodes.

With that, some cleanup changes to DList use of Option, and adding a missing Encodable implementation.
Remove unused variables in `compile_submatch`.

Just an minor cleanup.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>