Add support for account lockout (fix #58)

This adds the feature described in #58.
Wow, mega indentation!  Do we have promisified test infra in this repo?  If not then we should file a follow-up bug to add it and refactor this pyramid of doom.