BUG: Added better support for objects subclassing dict.

Our Positions and positiondict objects were being serialized as
dicts by msgpack. This resulted in KeyErrors post-deserialization.
Added support to handle serializing them correctly.