Added IndexBuilder class and fixed IndexBuilderTest