Add all ingredients except the oil to a blender or food processor and process until pureed. With the motor running, add the oil in a thin stream and process until emulsified. It will keep for 1 week in the refrigerator in an airtight container.
Place all ingredients except the lemon juice in a medium saucepan and mix to combine. Bring to a boil, then reduce to a simmer and cook, stirring occasionally, until most of the liquid has evaporated but with a small amount of syrupy liquid remaining. Transfer to a small, air-tight jar and cool to room temperature. Taste, adding lemon juice as needed to balance the sweetness. Store in the refrigerator for up to 2 weeks.