Heat a large sauté pan or skillet over medium heat, and add 2 tablespoons of the oil. Add onion and sauté until soft and caramelized, about 10 minutes. Remove onion and reserve. Add remaining oil to pan, then add fennel, garlic, bay leaves, and thyme. Sauté until fennel is soft and beginning to turn golden, about 10 minutes or so. Add wine and vegetable stock and stir, scraping bottom of pan to deglaze it. Let this cook for about 5 minutes. Stir in the onions, beans, lemon zest, and squeeze of lemon juice. Taste and season generously with salt and pepper. Transfer the vegetable mixture to a wide baking dish. Sprinkle topping over dish (see recipe below), cover dish with foil, and bake 30 to 40 minutes.