adding support for automatic index creation with some supporting unit tests