Extract state persistence into a mixin-style base class

As of now, only the Statistics class saves state on persistState events. We should make it possible to implement this behavior in other classes by simply extending some mixin and passing it a pydantic model that would validate the serialized state from the key-value store.

EDIT: SessionPool also supports persistence