Implement enum in key_data and fix naming of enums in key_data and key_state to not collide with the other database layer.