In a large, heavy saucepan heat the oil over medium heat and add the onion and garlic. Saute until they begin to wilt. Add the ketchup and chile paste and saute for 4 minutes. Add all of the remaining ingredients stir and let simmer for 30 to 40 minutes. As the sauce thickens, stir more often so it does not scorch. Remove the sauce from the heat and allow it to cool. Place the sauce in a blender and puree. Store in the refrigerator.
Red Chile Paste:
Place the ancho and Mexican chiles in a large saucepan and cover them with the chicken stock. Add the onion and garlic. Bring the stock to a boil over high heat, reduce heat and allow to simmer for about 15 minutes or until the peppers have absorbed some liquid and have become soft. Put the pepper mixture, cooking liquid, and chipotle peppers into a blender. Blend on low speed, increasing to high speed as the puree combines.