Use a gevent pool for actions syncback instead of Redis-plus-workers.

Summary:
This is much simpler, and we were probably going to change this eventually
anyways. The immediate reason for doing it right now is that the rq module
reconfigures the root logger, which is really annoying when you are trying to
actually configure it yourself.

Also, start the SyncbackService as a simple greenlet instead of a ZeroRPC
service (which it isn't really).

Test Plan: Unit tests updated, end-to-end syncback behavior manually verified.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D229
[inbox/vault] Move refresh token storage to a local vault.

Summary: Moves the storage of refresh_tokens to use the prototype vault API.

Test Plan: Run regression

Reviewers: emfree

Reviewed By: emfree

Maniphest Tasks: T117

Differential Revision: https://review.inboxapp.com/D228
Deduplicate a thread's participants by email address.
Use a less aggressive participant deduplication strategy.

Fixes T123.
Make bin/clear-db also keep 'secret' table if --with-users isn't specified.

Needed now that auth credentials are stored in that table.
* Update _process_log() for drafts.

* Test drafts reconciliation without a sync.
We now do this via two tests:
test_drafts_syncback.test_remote_save_draft() and test_reconcile_message.py,
which each test a separate chunk of that logic.
Remove old defn. of register_backends() from inbox.mailsync.backends.base
Fix crasher when Gmail 'Important' folder disabled in IMAP.

Summary:
We solve this by creating folder rows with a NULL 'name' when we have
the special Gmail label on messages but the corresponding IMAP folder is
disabled. If the folder is later re-enabled, we reconcile the existing
Folder row with the detected folder name, so messages will be properly
synced.

Note that adding `nullable=True` is merely making an existing default
explicit.

Test Plan: Manually disable Important on test account, sync messages, re-enable and verify resolution.

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D232
Port logging to structlog.

Summary:
Our existing log infrastructure was not a scalable solution. We'll
funnel these structured logs into LogStash+Kibana or a similar toolchain
for searchable logs and visualizations.

structlog makes it easy to bind specific params to a given logger, so we
get more context for debugging. Awesome!

Also configure logging to just write to syslog instead of various files. This
requires a bit of configuration of rsyslog, but I think will ultimately make it
easier to set up remote log forwarding, log rotation and similar fancy stuff,
without having to worry about any of it in the actual application code.

Test Plan: Unit tests updated, and mailsync/api servers run.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D231
Fix merge error between previous two commits.
Adapt logging setup to work when the API server is run under gunicorn.

Summary:
Run with:
  gunicorn --worker-class inbox.api.wsgi.InboxWSGIWorker --logger-class inbox.api.wsgi.GunicornLogger inbox.api.srv:app ...

This also requires some minor changes to our existing logging setup, because
gunicorn passes positional arguments in its logging messages
(`self.log.info('message %s', some_value)`) but structlog can't currently
handle that (https://github.com/hynek/structlog/issues/19).

Test Plan:
Run `bin/inbox-api` and `gunicorn --worker-class
inbox.api.wsgi.InboxWSGIWorker --logger-class inbox.api.wsgi.GunicornLogger
--workers=1 --bind 127.0.0.1:5555 inbox.api.srv:app` and make some API
requests.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D235