Add tests for email validation.  WIP: godocs.
Fix bugs.

I swear this code worked fine two weeks ago.