Store pending rules in global mode object.

This is a step toward cleaning up how rules are refreshed.
Details are in the section "How rules are updated" of scratch.md.