Introduce ObjectDatabase.CalculateHistoryDivergence()

Fix #562