Melt the stick of butter in a large pot over medium heat. Add the onions, bay leaves, thyme, and salt and pepper. Cook until the onions are very soft and caramelized, stirring every 5-10 minutes. Do this for at least an 1 hour (longer is better). Add the wine, bring to a boil, reduce the heat and simmer until the wine has evaporated and the onions are dry, about 5-10 minutes.