Login reset

Added various features.. See commit comments