Place beans and water in a large pot, and bring to a boil. Reduce heat to medium, and continue cooking 1 hour, stirring occasionally, until beans are tender. Drain, and transfer to a large casserole dish.
Preheat oven to 300 degrees F (150 degrees C).
Heat the olive oil in a skillet over medium heat. Stir in the onions, and cook until tender. Mix in garlic, and cook until golden brown. Mix onions and garlic into casserole dish with the beans. Stir in the tomato sauce. Mix in brown sugar, molasses, vinegar, bay leaves, mustard, pepper, nutmeg, and cinnamon.
Cover and bake 3 1/2 hours in the preheated oven, stirring frequently and adding water if necessary. Remove cover, and continue baking 30 minutes.