The young Sun and the atmosphere and photochemistry of the early Earth