Modernize meta-topics.

This adds index support to the topic models, incorporates the identifiers
feature for topic_id, and reformats a lot of the old code in meta-topics.
The code now compiles against the latest index and document classes.