Adds sign_in and sign_out functionality. Also tests.