pickler: trivial style fixes

Signed-off-by: David Aguilar <davvid@gmail.com>
tests: improve assertion in test_cyclical()

Signed-off-by: David Aguilar <davvid@gmail.com>
tests: add another cyclical test

Ensure that instances inside lists are properly referenced.

Signed-off-by: David Aguilar <davvid@gmail.com>
unpickler: simplify things by making _mkref() return its arguments

Chain more statements by making _mkref() into a pass-through function.

Signed-off-by: David Aguilar <davvid@gmail.com>
feature: handle references to lists

Allow lists to be seen by the referencing machinery.  This allows us to
store multiple references to the same list and properly restore these
references when decoding.

The trick is that we need to be able to create an object and keep a
reference to it before decoding its children.  This is possible with
lists because they are mutable.  The same approach will not work for
tuples, though, because they are immutable.

Signed-off-by: David Aguilar <davvid@gmail.com>