Added advanced email validation

form now validates email to ensure you have a valid email address.
Cleaned up the code to make it easier to follow.