[SCHEMA] Simplify transaction log construction; rework delta sync.

Summary:
Implement a leaner and meaner transaction log:

* Instead of storing an ORM-derived 'delta', only store a snapshot of the API
  representation of the versioned object. We weren't using the delta for
  anything.

* This lets us simplify the rather hairy ORM-history-inspection we were doing
  to figure out whether to create an update revision or not. On versioned
  objects, we just look at column-mapped attributes, and at relationship
  attributes named in the `versioned_relationships` property. If any of these
  have changes, we create a revision.
  (We don't look at all relationship attributes, because you don't
  need to version a Message instance if it gets a new ImapUid, for example.)

* Simplify and consolidate the revision creation code.

* Simplify the construction of delta sync responses.

Fixes T567.

Test Plan: Unit tests added.

Reviewers: spang, kav-ya

Reviewed By: kav-ya

Maniphest Tasks: T567

Differential Revision: https://review.inboxapp.com/D655
Return actual deltas in the streaming API; consolidate code.

Summary:
Instead of sending basically just a ping, `/delta/streaming` now returns actual
change responses, in the same format as the existing `/delta` endpoint.

Concretely, this means that response chunks look something like this (formatted
for clarity):
```
{
    "cursor": "4ya4oyxo7rurxamyt9brfju5b",
    "object": "thread",
    "event": "update",
    "id": "71ormxuivtg52p141tpgjk3vi",
    "attributes": {
        "namespace_id": "f3b0j663wmm2bluq77uc4db9m",
        "tags": [{"name": "drafts", "id": "drafts"},
                 {"name": "starred", "id": "starred"}],
        "last_message_timestamp": 1414778436,
        "object": "thread",
        "message_ids": [],
        "snippet": "",
        "participants": [],
        "draft_ids": ["diu1tytx7p9wnx64hdbxsypqe"],
        "first_message_timestamp": 1414778436,
        "id": "71ormxuivtg52p141tpgjk3vi",
        "subject": "Hello World!"
    }
}
```
The "cursor" value can be used to fetch subsequent changes if the client is
disconnected. As a client, you can keep track of the cursor for the latest
event you've processed, and query
`/n/<namespace_id>/delta/streaming?cursor=<cursor>` to get all changes starting
from that point and onwards.

To this end, consolidate logic for the `/delta` and `/delta/streaming`
endpoints, and update docstrings, etc.

Test Plan: Unit tests added/updated.

Reviewers: spang, kav-ya

Reviewed By: kav-ya

Differential Revision: https://review.inboxapp.com/D667
Search v1.0: Thread, message search for a namespace.

1. Script to create an Elasticsearch index for each namespace and index its Threads, Messages
s.t. they can be queried on both thread/message attributes.

2. DSL query constructor to construct Elasticsearch DSL queries for
* no restrictions/ field-restricted/ all fields
* exact phrase/ any match
* equally weighted/ boosted
searches.

3. API functions.

4. Docs.

5. Tests for:
Index creation.
Thread, message search.
Cross-attribute search.

Also basic script to test againt Gmail, using the Gmail Search API.

TODO:
1. Date range queries support.
2. Boost factor through API.
3. Expose in API: queries, score explanation.
4. Highlighting?