email templates, send_email function, token replacement API, tinymce autoloading and several bug fixes