More login related changes

Changes to exception handling
Adding ping messages
Login now works
Better event handling