Speed up cached_pass? for composite rules

Both `Or` and `And` would evaluate whether each rule passed, then calculate a
value based on the results of all of those. We can actually return early in many
cases, without running the rule at all.
86 jobs for declarative-policy-optimisations in 80 minutes and 9 seconds (queued for 42 seconds)