moved login and message loops to their own functions, login is still
not finished

UI version of client is most likely broken, don't use it for now