Authenticates the user to the server.
Closes the active connection.
Receives a message off the message queue and returns it as a JSON value.
See Implementation