The lower main sequence of the globular cluster M3 with the Hubble Space Telescope: luminosity and mass functions