Ok just as an update, on the weekend i cleaned the AFM and the AAC valve. This seems to have sorted out the stalling issue when i roll up to the lights. It idles very steadily at about 900rpm.
I then drove it for about 150kms, and it just stalled when i was driving. The dash lights come on. However, my hazard lights still work and stuff. It's quite scary. Anyway, i try turn on the car again a few times but it just doesn't want to start. If i take out the key and wait a bit i can start the car again. Does this mean that the problem is electrical? or is it the fuel pump?