Temperature is just an expression of mean kinetic energy of particles. If gases (especially light gases) are hot enough, their kinetic energy can correspond to a velocity that actually exceeds the escape velocity of Earth's gravitational well. This is how hot gases can be removed completely from the Earth's atmosphere (and then solar wind & radiation take care of removing it from there). Even at today's atmospheric temperatures, helium gas (molecular weight of 4 atomic mass units, much lighter than molecular oxygen, nitrogen, etc.) can escape from Earth's atmosphere.
(EDIT: actually, on second thought, N2 would have a higher molar weight than H2O...)
As far as methane, it seems to all mostly be biogenic[1].
[1] - http://www.astrobio.net/news-exclusive/methane-on-earth/
Isn't it possible that early Earth contained many times as much H2O as it does now (like some of those Jovian satellites that are covered in hundreds of miles of ice), and what we have now is simply what's left after the majority "boiled off"? That way, there would be no need for comets and asteroids to return the lost water to Earth.
Other comments in this thread mention vast amounts of water trapped deep inside the Earth, as well as outgassing of nitrogen after the Earth has cooled down. Perhaps the water near the surface of the early Earth did "boil off" entirely, but what we have now is the result of subsequent outgassing?
> One of the leading hypotheses on Earth’s formation is that it was so hot when it formed 4.6 billion years ago that any original water content should have boiled off. But, today, two thirds of the surface is covered in water, so where did it come from?