Allow AttrDict to be pickled

Previously, pickling would fail out with a recursion error (I believe because the code always assumed that certain properties were present and, on setting `__dict__` in the unpickle, that caused an infinite loop). This defines a custom pickle to make things work as you'd expect. Since pickling could not work previously, this isn't a backwards-incompatible change.

Please tell me if you want me to change any formatting here or there or if you want any other changes for coding standards.