Better handling of app lifecycle.

- Perform relogins when entire process is killed and so we start on an activity different from UserListActivity and without an opened database.
- Move database-dependent code from onCreate* on activities and fragments to a onDatabaseReady event.
- Added functionality for a complete clean application exit from any activity.