Added support for pickle and unpickle.

Added two methods, __getstate__ and __setstate__, those methods are used for pickle and unpickle.

This is need for using with some binary caching backend, like redis.