Added sending of CSV reports via email.
Refactor.