Cache compiled conditions for ConditionSwitch.

Previously, were re-compiling the expressions each time the
ConditionSwitch ran, which was leading to performance problem
when there was an absurdly large number of conditions.