Ensuring class indexes exist, and added API to persist lastKey of DomainClassInfo