Implemented auto saving methods in RulesState and made the test case pass.