Pickle index to state mapping and state to index mapping.