Added email validation, tests, gitignore and find a few bugs.