Added first step of password recovery. Refactored existing password logic.