Once upon a time some monkeys from Africa took a ride on a raft and landed in South America, which had long been separated from other continents. Like most contemporary mammals (including all other monkeys), these original New World monkeys were dichromats. They evolved into all of today's New World monkeys.
Meanwhile back in the Old World, a couple of mutations took place: the gene for long wavelength cones on the X chromosome was duplicated, and the daughter genes became differentiated, so that one of them became an L gene and the other became an M gene. Thus was born the first instance of trichromacy in our ancestors.
Since one gene was almost a copy of anther gene right next to it, errors during crossing over led to various numbers of almost-copies of the original gene. The first two such genes on an X chromosome code for the opsins in L and M cones. Other almost-copies are not expressed. Both L and M genes have many polymorphisms, which give rise to the most common color deficiencies (tabulated in the OP).
Meanwhile back in the New World, similar kludges arose independently in several groups of monkeys. Howler monkeys, for example, are trichromats like us. Some New World monkeys are dichromats, and some groups have trichromacy only in females (which is probably good enough, since a female trichromat can show other members of her clan where the best food is).
As kludged up as it is, our form of trichromacy must have given our ancestors a big advantage, since dichromacy has died out among Old World monkeys.
Here's a scholarly article about Müller cells:
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1895942/