https://en.wikipedia.org/wiki/Gram_panchayat , http://en.wikipedia.org/wiki/Panchayati_raj
The only real problem with this kind of a set up is, systems by and large become culture centric. And this leads to medieval mindsets. Stuff like banning couples from having falling in love or having a love marriage, or laws against polygamy, support for child marriage, unfair treatment to widows, honor killings ... stuff like that.
There are also some extreme cases: http://en.wikipedia.org/wiki/Khap
Where does this leave us? Despite all their flaws(basically their own definitions of morality and thereby their own laws based on that) these sort of systems are the easiest and cheapest way of resolving a dispute with a very high rate of acceptable justice. Which continues be the case in many places in India today.
Only recently have we been able to overcome it.
Were the seeds of religion sown in primitive peoples observations of and attempts to reckon with all the scary shit they would witness in the natural world? Absolutely. But any "definitive" statements on pre-historical belief systems are probably anthropological hearsay, possibly weighted by our current knowledge of and feelings towards religion. What was going on back then could have been just slightly more complex than a dog hiding under the bed when there's thunder.
And keep in mind, we're talking about a 200,000 year run up to recorded history. However, I'm sure there was a more complex oral tradition of storytelling and mythmaking that was starting to develop before the Sumerians took off.
Weherein we have some evidence that such was not the case with moving towards public law.