In a large pot on medium heat, combine oil and diced onion. Cook until golden brown and caramelized. Add garlic and cook for 2 minutes. Add spices and toast until fragrant. Add liquids, increase heat to medium-high, and reduce mixture by one half. Add tomatillos and ketchup, reduce heat to medium-low, and cook 1 hour until thickened.