Many-Body Theory Of Electron-Phonon Coupling In Polar Semiconductors And Superconductors