Rub the ginger, garlic and salt all over the chicken, then leave to marinate while you prepare the other ingredients (and for up to 4 hours).
For the curry powder, stir the dried spices in a large, heavy-based frying pan on a medium heat until browned and aromatic, then tip out and leave to cool.
Toast the rice until lightly browned, add to the cooling spices, then toast the curry leaves and 5 cm piece of pandan until they have dried out and add those to the mix, too.
Once everything is cool, put all the spices and rice in a blender or mortar, then whiz or pound to a powder.
Put the oil in a wide, heavy-based pan on a medium-low heat, then fry the onion for 5 or 6 minutes, until soft.
Stir in the garlic, ginger, lemongrass, cardamom, cinnamon and chilli powder, fry for a minute or so, then stir in the curry leaves and tomatoes and fry until the tomatoes soften.
At this point, unless your pan is very large, you might find it easiest to scoop out the contents before you cook the chicken.
Toss 3 tbsp of curry powder with the marinated chicken, then add to the pan with a little more oil, if necessary.
Turn to coat, then, if necessary, return the tomato mix to the pan and add the chillies and 10 cm piece of pandan leaf.
Measure out 200 ml water, stir in a splash to help dislodge anything that is stuck to the base of the pan, then pour in the rest of the water and bring to a simmer.
Cover, turn down the heat and leave to cook for 15 minutes.
Turn over the chicken pieces, stir in the coconut milk, cover the pan again and leave to cook for another 15 or so minutes, until cooked through.
Leave to cool slightly, then adjust the seasoning if required, just before serving with rice and perhaps a wedge of lime.