Repeat email v1

Also adds some badly needed testing infrastructure.
Out of curiousity, why was this removed?