Refactoring auto indexing to be more general, introducing PojoPersistenceListeners.