Refactor schema validation...

To make more use of dynamism of class, add test for type errors on
nullable/required constraints.