This is a big question and I think it will help to refactor it into some related questions:
What did Jesus see as his mission?
From the passages you cited and the fact that Jesus spent most of his time teaching Jews, it's not a stretch to say that Jesus saw his mission as limited to Israel. Now Jesus did go into the region of the Decapolis, which began as Greek colonies and at that time were heavily influenced by Rome. He also withdrew at the end of his Galilean ministry to Tyre and Sidon, which were ancient pagan cities. Mark emphasizes that he was going there to get a break and that he only helped the Gentile woman because of her clever appeal:
And from there he arose and went away to the region of Tyre and Sidon. And he entered a house and did not want anyone to know, yet he could not be hidden. But immediately a woman whose little daughter had an unclean spirit heard of him and came and fell down at his feet. Now the woman was a Gentile, a Syrophoenician by birth. And she begged him to cast the demon out of her daughter. And he said to her, “Let the children be fed first, for it is not right to take the children's bread and throw it to the dogs.” But she answered him, “Yes, Lord; yet even the dogs under the table eat the children's crumbs.” And he said to her, “For this statement you may go your way; the demon has left your daughter.” And she went home and found the child lying in bed and the demon gone.—Mark 7:24-30 (ESV)
So Jesus seemed to be telling the Gentile woman that her case was out of his jurisdiction, but he helps her anyway. After that, he begins his final trip to Jerusalem and never returns to the more Hellenized regions in and around Galilee. Mark, and the Gospels that follow his chronology, tell the story of Jesus' life as an inevitable collision course between Jesus and the top Jewish officials in Jerusalem. The interactions with the Gentiles become less important. If you don't know the end of the story, you'd expect that the climax would involve Jesus attempting to reform Temple worship, liberalize Jewish practice and expel the Romans.
It's important to note that John, which was written much later, does not follow that narrative at all. It starts from the first line asserting the view that Jesus' mission was to transform all of creation. We'll get back to John below.
How did the early church come to spread to Gentiles?
There's no question that the primary answer to this question is Paul. Over and over again, Paul asserts that preaching the Gospel to the Gentiles was his particular calling. (See Galatians 2 and nearly every line in Acts.) Paul's letters, which are among the first documents produced by the church, radically reinterpret Jesus' life as having cosmic significance. Paul spearheaded the drive to place a small-time provincial teacher and failed messiah on the center of the empire's civic and religious stage. For this to be a valid mission, Jesus must have come to earth for the sake of people other than the Jews.
Even so, Paul saw the churches mission to go first to the Jews:
For I am not ashamed of the gospel, for it is the power of God for salvation to everyone who believes, to the Jew first and also to the Greek. For in it the righteousness of God is revealed from faith for faith, as it is written, “The righteous shall live by faith.”—Romans 1:16-17 (ESV)
The synoptic Gospels, which were written after most, if not all, of Paul's writings, read a bit like very early "Quests for the Historical Jesus". Paul's arguments in Galatians that Christianity be extended to the Gentiles had already won the day, so the Jewish nature of Jesus and his ministry was at risk of being lost to time. Mark doesn't include any commands to go to the Gentiles. Matthew, of course, does when he tells of the resurrected Jesus meeting with His disciples on the mountain in Galilee. And Luke's gospel is really volume 1 of the history he continues in the book of Acts, which is the story of the church spreading to the heart of Rome herself. For Matthew and Luke at least, the mission to the Gentiles is commanded by Jesus after the cross—it's the church's mission.
In John's gospel, what is Jesus' mission?
Most, but not all, scholars date John as one of the very last New Testament books to be written. If so, it was well beyond the circumcision controversy. But the gospel seems to draw on even more Jewish background than the Synoptics. The interaction with the Samaritan woman at the well is a great example since it involves nuanced arguments that would go over the heads of anyone who hasn't picked up some Hebrew history. Jesus is very much Jewish in John's gospel.
However, it also has the strongest statements from Jesus about His mission being extended to the Gentiles. For instance, immediately after talking with the Samaritan woman:
Meanwhile the disciples were urging him, saying, “Rabbi, eat.” But he said to them, “I have food to eat that you do not know about.” So the disciples said to one another, “Has anyone brought him something to eat?” Jesus said to them, “My food is to do the will of him who sent me and to accomplish his work. Do you not say, ‘There are yet four months, then comes the harvest’? Look, I tell you, lift up your eyes, and see that the fields are white for harvest. Already the one who reaps is receiving wages and gathering fruit for eternal life, so that sower and reaper may rejoice together. For here the saying holds true, ‘One sows and another reaps.’ I sent you to reap that for which you did not labor. Others have labored, and you have entered into their labor.”—John 4:31-38 (ESV)
At that moment, Jesus would have been indicating Samaritan fields and perhaps even the Samaritan people who came to Him over then next two days. John tends to say things more round-aboutly than other New Testament authors, but the next paragraph makes clear the intended meaning of the parable ‘One sows and another reaps’:
Many Samaritans from that town believed in him because of the woman's testimony, “He told me all that I ever did.” So when the Samaritans came to him, they asked him to stay with them, and he stayed there two days. And many more believed because of his word. They said to the woman, “It is no longer because of what you said that we believe, for we have heard for ourselves, and we know that this is indeed the Savior of the world.”—John 4:39-42 (ESV)
The author puts the later church idea of Christianity spreading from Israel to all of Rome in the mouth of Jesus, but in an oblique way. Or if you think John is an accurate account of the life and teachings of Jesus, this only means that John rediscovered Jesus' full mission that was concealed during his lifetime. In either case, it isn't so much that Jesus changed the scope of his own mission during his life as that the church later understood his mission to be one of every-increasing circles of influence starting in Jerusalem and extending to the ends of the Earth.
During his life, Jesus focused primarily on interacting with his fellow Jews, but did not shy away from interactions with Gentiles when they crossed paths. Immediately after Christ's death and resurrection, the church understood her mission to reach beyond the cultural borders of the Hebrews to all people groups. The transition occurred at precisely the moment when it was no longer possible to sit at Jesus' feet. His followers depended instead on His Spirit, which was not tied to a particular location on Earth.