Issue/554/pickling productattr infiniteloop

This is my attempt to resolve the pickling issue. Thanks to Patryk for pointing out the __setstate__ magic method.