Tag index

Just starting on this, not for merging yet, but feedback welcome.
Ah, it's the named function parameter thing. OK.