Index v5

I'll start with some refactoring to put the v2 semantics into a seperat file.