Add validate_email unit tests and simplify validation.