Storage ring operation of the free-electron laser: The oscillator