[SCHEMA] Allow contact sync from arbitrary remotes.

Summary:
 * Rename g_id to the more generic uid.
 * Add a 'provider_name' column to the Contact table. This allows us to sync
   contacts from multiple backends for the same account without needing to
   worry about uid collisions between those backends.

Test Plan: Unit test added; Google contact sync manually tested to work.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D72
Fix a g_id -> uid renaming that escaped D72.
Fix to 'Un-stamped database!' bug

Summary:
Attempting an ./inbox start (for example) after running ./tools/clear-db results in an 'Un-stamped database error';
clearing the db drops the alembic_version table, hence the check for it in inbox:283 fails.

This commit fixes the problem by always including the alembic_version table in the tables kept i.e. not dropped

Test Plan: All scripts work as before.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D82
Set uid for locally added contacts.

uid is no longer a nullable column for contacts.
Test code restructured.

Summary:
To allow different providers to be tested independantly:
tests/general: provider agnostic tests
tests/imap: Imap tests
tests/data, tests/util: data + utility needed for tests.

Note: EAS tests live in the corresponding tests/eas directory in the inbox-eas repo.

Test Plan:
./runtests passes all as expected (i.e. depending on the value of the EASTEST flag)

Reviewers:
spang, emfree

CC:
emfree

Differential Revision: https://review.inboxapp.com/D63
Add pytest engine for Arcanist.

Summary:
You'll need to do `pip install coverage` in your VM.
Tests can be disabled by running `arc diff --nounit`.

Test Plan: Run arc diff --preview on some test commit.

Reviewers: spang

Reviewed By: spang

CC: kav-ya, mg

Differential Revision: https://review.inboxapp.com/D84
Minor updates to general contacts sync.

Summary:
Add contact UID type assertion.
It's easy to accidentally pass an int rather than a string, but doing so is Bad
News.

In Contact.copy_from, copy fields whether or not they're None.
This is needed to properly sync individual deleted attributes of EAS contact
objects.

Test Plan: ./runtests

Reviewers: kav-ya

Reviewed By: kav-ya

Differential Revision: https://review.inboxapp.com/D86
Move table+column creation into the `create_db.py` script, which is run at setup.

Summary:
Previously we allowed this to run everytime on startup, which broke some alembic revisions by creating new tables before a migration was run.From now on, we should ony be creating tables+columns via SQLalchemy *once* and all subscequent changes done via migration scripts.

Inspried by a chat with Selena Deckelmann. :)

Test Plan: passes all tests.

Reviewers: emfree, spang

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D89
rudimentary support for replying to a thread
check for config file, PYTHONIOENCODING, remove pyc, and colorize
goofy mg
Move misc utils back here.

Separating them out while things are still changing so quickly is too
confusing. We can rip out code we want to share later.
wip
wip
wip
wip
Sending uses a connection pool
fix send mail
WIP of pluggable backends for sending mail
Send code restructured (as in D83)
WIP

Test Plan:
Works as before -
Use test_sendmail.py to send a test email to kavya@inboxapp.com, kavya719@gmail.com
Note the test uses test account id = 1, so there's atleast one account stored in the db.