Add a hash table to the subgoal table making lookups of facts fast.
This replaces an implementation that did a linear search of the facts.