Enhancements to IndexDatabase and indexQuery to improve extensibility