Generate partial classes.
Fix bug when using states. Rules that do not explicitly reference a state should be included in all states.