Refactor password resetting, close #29.