buildbot: change Stats to a more generic approach; fix pyflakes warnings; add util.py sendmail()
buildbot fix