[build/setup.sh] Fix install permissions when the host has umask 0077

Test Plan:
- Add "umask 0077" to my .bashrc
- vagrant destroy
- vagrant up --provision
- Check the permissions of
  /usr/local/lib/python2.7/dist-packages/pip-1.5.6.egg-info/entry_points.txt
  inside the VM.  It should be world-readable.

Reviewers: siro

Reviewed by: siro
Spawn a remote debugger in a separate greenlet

Summary: This code adds support for spawning a remote debugger if the DEBUG_CONSOLE_ON is specified. The debuggers listens on localhost on port $PID for telnet connections. It gives access to a simple REPL with the possibility of using the heapy heap profiler to inspect the heap.

Test Plan: Ran the code.

Reviewers: emfree, charles

Reviewed By: charles

Projects: #sync-engine

Differential Revision: https://review.inboxapp.com/D637
Add support for user-provided IMAP settings; refactor auth.

Summary:
This commit implements support for user-provided IMAP and SMTP settings, along
with related cleanup and refactoring in the auth code.

* Allow IMAP and SMTP endpoints for ImapAccounts to be overridden on a
  per-account basis.
* Define a "custom" provider for accounts with such overrides.
* Refactor auth modules to move functionality into AuthHandler classes.
* Refactor OAuth code, consolidating functionality split between the
  inbox.oauth and inbox.auth.oauth modules.
* Define interactive_auth() method on AuthHandler subclasses, to handle the
  flow of authing via bin/inbox-auth. Previously, this functionality was partly
  implemented in create_auth_account functions, and partly scattered.

Test Plan:
Add unit tests; add account with custom settings and ensure that
sync and sending works; run bin/inbox-auth for different account types.

Reviewers: charles

Reviewed By: charles

Differential Revision: https://review.inboxapp.com/D639
Fix typos in OAuth interactive auth.
Also fix create_account parameters in unit tests.
Add super simple search interface and indexing script to API.

Test Plan: None, for now.

Reviewers: kav-ya

Reviewed By: kav-ya

Differential Revision: https://review.inboxapp.com/D644
[SCHEMA] EAS Two-Device-Per-Account migrations.

Also,
Add BaseMailSyncMonitor._cleanup()
Move thread state fns out of BaseMailSyncMonitor.
Update bin/clear-db.

And,
Migration to fix EASUid cascade deletes.

Summary: Matching changes to D629.

Test Plan: None

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D632
Fix post cherry-pick migration ordering.
WIP
move to mutablelist
address review comments + added a script to update old imapuids
updated db dump
address review comments
make update script work
also upgrade test db
updated how we remove labels
forgot flag
made things work
address comments
fixed null bug