Add __set_state to every class