Refactors templates to separate LaTeX and Html
Sends mails when survey is submitted