Two epochs of globular cluster formation from deep field luminosity functions: implications for reionization and the Milky Way satellites