Migrate to a validator and rule hierarchy for function definitions.