What form of engine management are you running? Are you using an AccessPort? If they visually check for a catalytic converter in your car, and it requires it in your state, you will not pass emissions.
Regarding the lighting:
The lights are generally connected on the same relay altogether. That way you can't have your high beams on full bright without your headlights on/ fog lights the same. Because of that, if you have a wiring problem somewhere in that circuit, it can screw up all of it. When I changed out the headlights on my '02 it was difficult to do the wiring correctly because it's a common power with switched grounds for all of the lights. That being said, if you wired it backwards on the fog lights, then it can short out the rest, even though light comes out of them. If you replaced them and didn't do any wiring, you may have a problem in that relay. That circuit goes a lot of places. It will go under your dash on driver and passenger sides (passenger side for DRLs), it goes up to your steering column (for the wand to turn them all on), and it goes under the hood of course. Check to make sure all of your lights actually work. You can do this by connecting them directly to power/ground at a 12V source. Please don't do it if you're not already 100% positive how to do that safely. You can then use a test light with ALL of the other lights plugged in and test each plug one at a time. If all of the lights are not plugged in this won't work correctly because they're all connected. I hope that helps.
I doubt the lighting problems you're having have anything to do with your CEL. Fill us in on your engine management and we might be able to help more. I'd also find out exactly what your tuner has done, because I would be concerned if my tuner were the one working on my car and still can't solve a CEL for an O2 sensor. . . I'm not trying to raise suspicions, but I would look into it still.