Added an ID field in the key_data object that points back to another key_data object that is the predecessor.
Change a bit of the semantics and returns around rule1()/rule2()/rule3() and exists().