Initial login and long polling logic added

Code doesn't do anything useful yet.