implements logout clearing saved user credentials along with test for that