More work on adapting indexgen, and pulled in overrides for "reference" mode of "indexterm" template.