Refactor the Schema class.

Reorder the parameters of Schema->isValidInternal().