Add session-clearing to all tests that need it

Add test for logout (clearing a session) in the source
unit tests. Also clear sessions in integration tests
whenever a source/journalist is probably going to
close their browser.