A versatile new synthesis of quinolines, thienopyridines and related fused pyridines