New topic action: thread-history

New index on PostRevision indexes revisions by the root post of their topic
tree. Creates a query-only 'topic_root' field which when queried with
options matching the index will return the sorted history of that topic.

Also includes a few other minor fixes.

Change-Id: I6f0553f06a98e42f739bcad388cbec340db3718d