The DB implementation expects secrets to be base64 encoded blobs.
Because of this a bunch of tests broke moving to sqlite.
A lot of this commit is fixing those tests.
Invite emails are essentially just reset password emails with a
different template (though this can and probably will change (slightly)
in the near future)