Add various tests. Logout almost works.