lib: splitted the "performLoggin" function into two functions.
lib: splitted the "performLoggin" function into two functions.

This way we separate the part where we interact with the user, and where we
interact with the server.

mssola/td,mssola/td,mssola/td