Added Application class; Proper login and logout