Yes, God was dealing with Israel as a separate people unto himself, with special laws to show that and to protect them, like not eating pork, or washing their hands in running water if they touch something unclean, or killing a witch. That was a different age and was specifically to set Israel apart as God's chosen people through whom he would eventually send the promised Messiah, Jesus to pay for the sins of all mankind freely by our simply accepting the free gift.
When reading the biblical history one can see different ages or dispensations wherein God deals a bit differently with man. (each one ushered in usually by some sort of supenatural events or miracles to show man it was from God)--actually miracles in the Bible happened with many years between them. There was the Age of Innocence in the Garden of Eden, the Age of Conciousness where man did what was right in his own eyes, then the Age of Human Government, where the law was only if you kill someone you must be killed, then the Age of Promise to Abraham, then the Age of the Law given to Moses and the Israelites. Now we are in the Age of Grace, or the Church Age, next will be the Age of the Kingdom, which is the 1,000 yr. reign of Christ on Earth, and then The New Heavens and New Earth or Eternity.
Note, the ten commandments are the founding stones of the US laws except for sabbath-keeping which the first christians, who were jewish, began meeting on Sunday, to show the radical change that happenned as Christ rose on Sunday morning. The old laws (not commandments) are replaced by a higher law of love, and grace, which far exceeds the old. The commandments are good and holy, but are there to show us that we are, in fact, sinners, that we could not be in God's holy presence for a split second without being consumed. So we have Christ's righteousness freely given to us, covering, and even washing away our sin, and God said he is satisfied with that payment. (Isaiah 53) and read Romans. Hope that helps!