Teach InMemoryModule to work with custom index types Change-Id: Iac9b5b825878069783f98aaf77352ff4533a49b6