implemented a default _ana_getstate and _ana_setstate that serialize/deserialize the whole object