Login and logout functionality implemented, and code structure modified
slightly