Work function measurements with a high resolution electron energy loss spectrometer: Application to the interaction of oxygen with Ag(110)