Index term macros and tests

- also factor out the csv delimiter regex

This pull request may cause merge conflicts once the other pull requests are processed. Please advise if you need me to fix it up once it gets to the top of the queue.