In a skillet, heat 3 tablespoons of oil. Add the onion and cook over moderate heat until translucent, 4 minutes. Add the garlic and ginger and cook until fragrant. Add the ketchup, vinegar, tamarind, molasses, sugar, mustard and cayenne and simmer over low heat, stirring, until reduced to 1 3/4 cups, 5 minutes. Stir in the garam masala and season with salt and black pepper.