Implemented tests for RuleIndex + sorted iteration