Clean up validation.py and associated documentation.

I think this also fixes #113 (at least, what's left of it and wasn't already fixed).