As far as the engine turning off, it could be a lot of things, but the first thing I would suspect is the IAC (Idle air control, I think). As far as the CEL, you should be able to take the car to an autozone, and they will read the codes for free. Whatever is making the car die could be lighting up the CEL.