Chop the shallots, and fry them a bit in butter. Add the rest of the ingredients, minus the sugar and butter. The onions are there because they add sweetness.
Let it simmer (not boil) until it has reduced to half the original amount (for this batch it usually takes 20-30 minutes).
Sift it to get rid of the onion/thyme/bacon.
Pour the sauce back in the pan, and add the butter and sugar. Stir until the butter and sugar has dissolved, and taste it.
If needed (purely a taste preference), add a bit more sugar.
The sauce should be a bit thin, but if you like, thicken it just a bit with corn starch.