Account lockout

This is a work-in-progress branch for implementing account lockout, as described in #801.  The first commit is a concrete API spec, for discussion.

Things of note:

* The `resend_code` endpoint has the usual oauth continuation mumbo-jumbo, in keeping with other email-sending endpoints.
* The `verify_code` takes both `uid` and `code`, in the same way that `recovery_email/verify_code` does.  I'm not sure this is a good idea since we will have to make sure the verification page as the `uid` available.  But it's unauthenticated so it can't take the `uid` from its authenticated context like `password/forgot/verify_code`.

@dannycoates @zaach @ncalexan f?
> Is this change intentionally part of this PR? It seems tangential.

Yes, but it'll probably go away - the trick is right now I'm re-using the same `emailCode` db field for both verification emails and unlock emails.  This was just to get something working to test against, I plan to clean it up to use separate codes for the final version.

> Will this endpoint unlock a user's account if it is locked?

No, I think that would be surprising behaviour.