Add tests for logout/login

Fixes #74