WIP: first preliminary working version of relocating index checks

Still include debug messages and need some polishing.