Modularized Analyze; added daily stats routine; switched to sendmail

Signed-off-by: oleg komarov <o.komarov11@imperial.ac.uk>