Add tests, improved validation, and form fixes.