Logins

Small refactorings. No hard stuff yet. :P
Quite unfinished branch, there if you wish to check it