Effective lagrangians for bound state problems in QED, QCD, and other field theories