Allow index_name to be a proc.

This allows very flexible index naming, based on tag, time or record fields.