Preserve rule definition order when looking up possible relevant rules

Switching to storing rules directly in a hash to improve lookup time led
to the (untested) regression that the last applicable rule would not win
as rules were evaluated in subject-last-seen order, then definition
order.

Therefore, switch to storing simply in the hash values a list of the
positions of the rules in the rules array, thus allowing preserving the
definition order when evaluating.