Finish up login, auth check, logout

Finish up login, auth check, logout and header username without testing,
hopefully everything works fine.