Make unsupported types return an error.

Specifically validator functions now return an error if given an
unsupported type as an argument.

This also means that tests have to support validate returning an actual
`error` in addition to the normal `[]ValidationError`.