Rewrite of email

Email fix to accommodate hackers

partial rewrite of chat allowing the storage of 'last_read_date'