Cleaned up and wired login/reg code