Probing Nanoscale Optical Fields and Phase-Shaping Electron Beams by Inelastic Electron-Light Scattering