Initial indexing implementation and tests.