What trajectory has the Cosmic Microwave Background radiation taken to get to earth? I have a few related questions:


*

*Where is the CMB coming (emitted/reflected/remitted) from? 

*When CMB hits the earth, is that the first thing those photons hit since they were emitted 400 thousand years after the big bang?

*Why isn't the CMB at the edges of the universe? Why is it flying around in the middle? Has the trajectory of the photons been bent by masses in the universe until it bends back inward? Or is the theory that the universe wraps around on itself?

 A: I will reply to 

Why isn't the CMB at the edges of the universe? Why is it flying around in the middle? 

The occurrence  of space time and matter after the Big Bang happened to all points in our universe. The expansion of space happened at the same rate outwards for all points of the universe. All points of the universe 380.000 years ago had electromagnetic radiation decoupled from matter, when neutral matter was formed, at all points of the universe.
Light that at 380.000 years after BB started from the point where we are now, is traveling on the expanding space with the velocity of light away from us. What reaches us is light  from all the other points of space that have taken the appropriate light years  to reach us.
The Cosmic Microwave Background for this reason, the expansion of all points in space, is mostly isotropic. The small variations in intensity are interpreted as accumulation of light coming from distant regions of the Universe,

The glow is very nearly uniform in all directions, but the tiny residual variations show a very specific pattern, the same as that expected of a fairly uniformly distributed hot gas that has expanded to the current size of the universe. In particular, the spectral radiance at different angles of observation in the sky contains small anisotropies, or irregularities, which vary with the size of the region examined.

CMB is the main observational tool that confirms the Big Bang model.

Has the trajectory of the photons been bent by masses in the universe 

A bit of bending happens if the photon has passed strong gravitational fields,

until it bends back inward?

No. It is that the expansion starts and continues on all points of the universe. All points of the universe are the center of the universe, in that sense.

Or is the theory that the universe wraps around on itself?

No. See above.
A: At a basic level:
The universe, in the beginning was very hot.  So hot in fact that there were no atoms, only electrons and protons and neutrons and photons flying around.  The photons were scatting off of the electrons and protons, as they interacted strongly because the electrons and protons are charged.  The universe was much like the plasma you find in plasma balls, but turned up to 11.  It was opaque. You could not see through it.
As the universe expanded, it cooled and at around 380,000 years after the big bang, it was cold enough that stable atoms could form.  At this point, all of the photons that were flying around suddenly stopped reacting with all of the free electrons and protons, since they started to form atoms that had no net charge, behaving much like a very dilute gas, like the air. The universe became transparent.  Just as we can see through air, at this point the photons could travel unimpeded.  This is referred to as the "surface of last scattering", but you shouldn't think of it as a surface, you should think of it as a moment in time where the universe went from being opaque to light to being mostly transparent to light.
Having suddenly nothing to interact with, those photons just starting travelling in straight lines.  Some of those photons were just the right distance from us and were pointed in just the right direction that they are hitting us just now.  In fact, they are hitting us continuously since the entire universe was filled with this photons just before the universe went "transparent".
So, the CMB isn't at the edges, its everywhere, its all of the photons that are still to this day flying off in every which direction.  Occasionally those photons hit something, but since the universe is mostly empty space, the fraction that hit something is completely negligible.  It is safe to assume they have not interacted with anything since the "surface of last scattering" nearly 14 billion years ago.
Nowadays, those photons are long in wavelength, nearly 1 mm, because as the universe has continued to expand, they continue to cool and stretch in wavelength.
A: The CMB radiation is the "temperature of the universe"
Approximately 379 000 years after the Big Bang the ionized hydrogen (free protons and electrons) had cooled down to about 3000 K, and thus became "transparent" hydrogen due to ionization ceased.
For each time point later the hydrogen cooled down "exactly" as much as the universe expanded.
In other words, when the universe expanded by a factor ( from "delta" up to about 1090) the hydrogen gas cooled down by "exactly" the same factor (from "delta" up to about 1090).
Thus we see all the interstellar gases between the galaxes (mainly hydrogen) temperatures as a single temperature (a common temperature radiation) from 379 000 years after Big Bang (about 3000 K) to today (about 2, 73 K)
That is why the background radiation has such a precise Planck distribution (heat radiation) that it has.
From Wikipedia: http://en.wikipedia.org/wiki/Cosmic_microwave_background
The glow is very nearly uniform in all directions, but the tiny residual variations show a very specific pattern, the same as that expected of a fairly uniformly distributed hot gas that has expanded to the current size of the universe.
Update:
In my answer I am saying that the CMB is coming from everywhere in space outside the hot areas warmed up by gravitation, fission or fusion processes, mainly stars.
