Added functions to login and logout and functional tests