Tag index

Just starting on this, not for merging yet, but feedback welcome.
It's for the caller to pay attention to. It's useful if there is some sort of validation error, which can get put through to the caller.