The day before you want to cook your baked beans, place the dry beans in a large bowl. Cover with water and let them soak in a warm place overnight or for about 8-12 hours. Drain and rinse them well.
Place the soaked and drained beans in a heavy bottomed saucepan. Add the tomato paste, soy sauce, molasses, onion powder, garlic powder, salt and stock. Stir lightly together.
Turn the heat on medium high. When the beans start to boil, reduce the heat, cover the pot and let the beans simmer gently for about two hours. Check the beans once or twice while they cook to see if there is still enough liquid in the pot - add a little more stock or water if necessary.
When the beans are tender, it is time to thicken the sauce. Place the flour in a cup and add a few tablespoons of the cooking liquid to it. Mix well with the back of a spoon so it becomes smooth, with no lumps. Add this to the pot, stirring gently and let simmer for a couple of minutes until the sauce thickens.
Take the pot off the heat and stir in the butter. Serve hot with some sourdough biscuits or toast. Some breakfast sausages would be a nice addition too!