Electronic states in liquid and amorphous metals. I. Optical theorem and multiple-scattering theory