Test session expiration and initial app loading.

Refactor keep alive tests.
Add scheduler and mock library to requirements.txt