Basic Fixes for the event module

* Fix event module to read email settings from db and generate correct salt for decrypting the password
* Fix event js to avoid a bug when adding and deleteing events on the frontend