Add support for validation warnings.

Got the code in trac ticket #23 working, moved doctests into a TestCase