I ran a search because I'm having a similar problem with gas mileage.
If you pull off the O2 sensor there will probably be a lot of carbon material on it, much like what you see on the inside of your exhaust tip. If it was giving a bad signal, or was not working properly, your engine light would go on. I ran into this problem when I had a shop install my exhaust. If you do take it off, clean it up, replace, reset ECU, and see what happens.
Other things to check for:
Clogged air filter
Bad spark plug wires
Misfiring spark plugs (this may be caused by the previous suggestion)
Clogged fuel filter (replace this if you haven't done so)
When you replaced the cap and rotor, where did you get the parts from?