Question: Is religion a vestigial organ?

Religion must have been a very advantageous development to early humans, because scarcely an archaeological record exists without some evidence of its influence. I can think of a bunch of factors that would have conferred advantages to religious groups: social cohesion/structure, group pride, environmental responsibility, faith to maintain psychological integrity when facing adversity, ritual purity (the precursor to health consciousness), the list goes on. Looking at religion through an evolutionary lens, it follows that humans with a neurological predisposition toward religious impulses would be selected over the more short-sighted, self-absorbed, primitive ones. So here are some questions: Is the religious impulse an evolutionary holdover? Or, Is religiousness a genetically-inherited trait?

Has the development of technological civilization overshadowed religion's evolutionary advantages?

In today's world, does one population, religious or irreligious, have an advantage over the other?