Support collections.defaultdict

jsonpickle now recognizes the collections protocol for defaultdicts.
When the object contains a 'default_factory' attribute we pass it to
the the constructor when present.

'default_factory' must be a type with an argument-less constructor.

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

Support deque objects by introducing a new check for
"list-like objects" which are basically objects that implement
can be iterated and updated like a list.

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

We can now serialize named tuples whose class definitions live
at the module scope.  We cannot (obviously) do anonymous namedtuples,
but supporting recommended best-practices for namedtuples covers
the common case.

We detect namedtuples by checking the class object for a "_fields"
member and compare its length to the {"py/seq": [...]}
inner list length.  When these are equal then we pass a restored
version of the inner list to the default constructor.

Signed-off-by: David Aguilar <davvid@gmail.com>
docs: jsonpickle supports namedtuples

Closes #34

Signed-off-by: David Aguilar <davvid@gmail.com>
Merge pull request #35 from davvid/collections

Collections