Dynamics of Glasses and Glass-Forming Liquids Studied by Inelastic X-ray Scattering