Tag index

Just starting on this, not for merging yet, but feedback welcome.
Actually, I see it's in a tx, so I guess no.