Sort through the beans and remove any small stones and chaff. Cover them generously with water, and set them aside to soak for 6 hours, or overnight. (Alternatively, cover them with boiling water and let them soak for 1 hour.) After the beans have soaked, drain them; then cover them with 4 cups fresh water. Bring to a boil with half the sage, the bay leaves, the whole garlic cloves, and a tablespoon of the olive oil. Simmer for ½ hour, add ½ teaspoon salt, and continue to cook until the beans are tender but still hold their shape, 45 minutes or longer, as needed. Drain the liquid and set it aside to use in the gratin or in a soup.
Warm 4 tablespoons of the oil in a wide skillet with the rest of the sage and the thyme, then add the onions, the chopped garlic, and 1 teaspoon salt. Cover and cook slowly until the onions are completely soft. While they are cooking, seed and chop the tomatoes; then strain the juice to remove the seeds. Once the onions are soft, add the eggplant, stirring well to combine; then cover and cook over medium heat for 10 minutes. Add the tomatoes with their juice, and continue cooking until the eggplant is tender.
Transfer the vegetables to a bowl and add the cooked beans. Season with plenty of freshly ground black pepper, and more salt if necessary. If a stronger flavor of sage and thyme is desired, add more, rubbing the dried herbs first between your fingers. The mixture needs to be well seasoned.
Preheat the oven to 350°F. Lightly oil a gratin dish large enough to hold 8 cups. Pour in the beans and vegetables. There should be enough liquid to come halfway up the sides of the dish. If more is needed, add some of the broth from the beans. Mix the bread crumbs with the remaining oil and spread them over the top. Bake the gratin until it is hot and bubbling, and the crust is browned, about 30 minutes.