notmuch-index-message: Separate gen_terms_body into its own function