[SCHEMA] Explicitly schedule syncback actions, instead of using the transaction log.

Summary:
Fixes T167, by removing the offending code altogether.

Instead of inferring syncback actions to execute from the generic transaction
log, explicitly store them in the new ActionLog table. This provides the
following benefits:

 * It's easier to ensure that syncback actions are executed when they should
   be. For example, if a user marks a single message as read via the API, we
   want to sync that back. But if we change a message's read status in
   mailsync, we don't want to schedule a syncback action. It's currently
   impossible to distinguish those two scenarios just by interpreting the
   transaction log. Similarly, we had to clunkily distinguish between tags that
   were set via the API and tags that were set from mailsync.

 * The SyncbackService doesn't need to process the *entire* transaction log.

Test Plan: Unit tests, and manually san-checking syncback actions.

Reviewers: kav-ya

Reviewed By: kav-ya

Subscribers: spang

Maniphest Tasks: T167

Differential Revision: https://review.inboxapp.com/D248
[SCHEMA] Migration to cascade Folder deletes to EASUid
[SCHEMA] Migration to remove EASFolderSyncStatus + Folder rows we never sync.
[SCHEMA] Fixes T171: Data too long for column message_id_header

We up the max column length to 998 in accordance with http://tools.ietf.org/html/rfc4130 (section 5.3.3)
(We can't truncate this header because it is used to populate the In-Reply-To header on
messages we send).
Add a try/except to  migration 061.
Port bin/inbox-* to click.

Summary:
We're already using this library elsewhere, and it's a lot cleaner to
use than argparse. I did some consistency tidying as well.

This is a precursor to modifying bin/inbox-start for multicore support.

Test Plan: ./runtests, manual verification that scripts start as expected

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D254
[DEPENDENCIES] Update to latest click.
[Monocle] Filter accounts by provider + state (v1)
[SCHEMA] Rename migration.
For real.
Migration 061 should delete RecipientInfo rows for all accounts.
[SCHEMA] Drop part.misc_keyval column.

We have no plans to use this data, and a lack of logic for truncation is
causing some messages to break syncs.

Fixes T177.
Don't retry on DataError and IntegrityError.
[SCHEMA] Make Message.*_addr non-null to prevent TypeErrors.

In Thread.participants, we assume that these attributes are iterable, but they
may not be set at all in case of decoding error. It's generally safer to have
them maybe be the empty list, but never null.

Fixes T181.
Fix previous migration down_revision ID.
Make slow query logging more structured.

Also add support for log.exception, which may be called by gunicorn.
Fix bug in migration 064.
Fix sending error when subject parameter is unset.

If we're sending a reply to a thread and there's no subject given, use the
thread's subject; otherwise use the empty string. Fixes TypeError in gmail
sending code.
Fix bug in g_msgids() affecting Gmail message deduplication.

We occasionally were failing to deduplicate message object creation or
download because we wrongly excluded messages which currently had no
associated ImapUids. (This is actually a common situation, as when a
message moves we might well delete the old ImapUid before creating the
new one.)

Fixes T180.
Remove unused import in inbox/crispin.py.