Replace the fuel filter.
Then low pressure bleed or measure pressure from the lift pump.
Then Test the injectors.
If it idles rough, crack the high pressure line to each cylinder. When you crack the line and fuel starts spewing, the idle should change because the cylinder would not longer fire (it should get rougher). On those cylinders that the idle does not change, have someone snap-test and clean out the corresponding injector(s) at the local injection shop.
Whiteish smoke, in my rig, was always an injector problem, or an air problem. So check for air in return lines, line from the lift pump to the injection pump (there is a fitting hiding under the intake heater structure there), do a low pressure bleed, and when you crack the injectors (high pressure bleed is a side-affect of this) make sure that all fuel bubbling stops and clear fuel is running before tightening the high-pressure line back down.
If an injector never bleeds out and continuously runs foamy, it's because it cannot reseat after firing due to debris stuck in it - often pieces of your injection pump coming apart.
Timing will help too, but I'd start with the above first!
good luck, jon