Theory of Extended X-Ray Absorption Fine Structure