98 Contour V6 Duratec 24v 2.5L Auto

1. I bought the car not running so I have no history on it.
2. The engine was turning and kinda trying to start
3. Replaced the cam position sensor with a known working one, reset the ECU, turned the key 3 times to build fuel pressure (I could hear the fuel pump building it up)
4. Turned the key and the car started. It runs but it is idling rough, misfires and backfires in the intake tubes. Has no power, hard to rev and more pops come when trying to step on the gas.
5. Replaced the crank position sensor with a known working one - Runs as described in # 4.
6. Replaced spark plugs, wires and coil. Cleaned the MAF, new air filter and PCV valve. No obvious vacuum leak, at least nothing visible on the plastic and rubber hoses. Fuel valve sprays strong. Runs as described in # 4.
7. Took it for an OBD II check although there was no CEL. 2 codes came up
P0171 - System Too Lean - Bank No. 1
P1152 - Lack of Upstream Heated Oxygen Sensor Switch - Sensor Indicates Rich - Bank No. 2.
8. Replaced the fuel filter - Runs as described in # 4.
9. Replaced the fuel pump - Runs as described in # 4.
10. The spark plugs on the front side of the car were black with carbon. The ones by the firewall were clean like washed from the gas. All of 6 of them smelled like fuel.
11. Rebuilt the UIM & LIM, as described in the MODS section in this site and installed new spark plugs - Runs as described in # 4.

Any suggestion guys as my partner and me are running out of ideas?
I really Hope that you can help me solve this puzzle...