Heat oil in large non-stick skillet. Add onions and salt. Sweat onions for 15 minutes until soft, translucent and sweet.
Combine fennel seed, coriander seed and cloves in a mortar, spice grinder or flavor shaker. Grind well. Add to onions with ginger, garlic and chile pepper. Add black pepper and salt.
Quarter tomatoes and add to pan. Tear basil leaves off of stems and reserve. Chop stems coarsely and add to pan. Add tomato puree, vinegar and brown sugar. Bring to a boil, reduce to medium, and simmer 30-40 minutes.
Roughly chop basil leaves. Turn off heat and add basil; stir well.
Transfer to blender and puree smooth. Work in batches, filling the blender jar no more than half way. Pour into a fine sieve and push through.
Sterilize some ketchup bottles and a funnel, either in boiling water, or dry in a roasting pan in a hot oven. Stir ketchup well and transfer to bottles. Fill bottles completely before sealing. Allow to cool completely, then store in a cool dark place for up to 6 months. Refrigerate after opening.