Mostly cleaned up the code based on the last code review
Added a few notes on possible problems with email validation