Id flag for table entity refs.
Rules/predicates for earliest ref detection.
Allow InRelationshipLabelRule to handle both directions depending on order.
Minor cleanup.