Added generic functions to make `*term*` and `*doc*` methods polymorphic about their input types. Added `sorted_topics` method. Replaces `relevant_topics`.