Heat the olive oil in a medium saute pan over medium heat and add the onions. Cook slowly until they start to lightly caramelize, about 15 minutes. Slice the tomatoes in half, squeeze out the seeds, then roughly chop. Add tomatoes to the pan along with both sugars, lemon juice, vinegar, salt, mustard powder and chili flakes. Cook until the mixture has cooked down and thickened, about 15-20 minutes. Turn off the heat and allow to cool. transfer to a jar or container. Jam will keep in the refrigerator for about 3 weeks.