Quick fix for 'KeyError: "flagged"' on new session

Fixes #185. We need to set the flagged variable on login, since
most people will clear sessions between checking for replies.
Simulate session logout in test_reply

Realistically, clients will clear sessions between submitting
docs / checking for replies, so we should simulate that.
test.py will now fail before 195d0ef and pass after, as
expected.
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.