Some preparatory refactoring to modularize ValidationTransform into separate, isolated steps (find rules, describe expressions, rewrite) that can be tested separately.
Slightly simplified transformation code.