The nature of the mid-infrared population from optical identifications of the ELAIS-S1 sample