Repeat email v1

Also adds some badly needed testing infrastructure.
I think that really belongs in its own bug.