Change text validation to be more restrictive

Fixes #397. Also modified email address validation so that the check occurs
only upon hitting the submit button and not as the user is typing.