"Yank" is much, much older than WWII - "Yankee" probably came from the disparaging term for Dutch settlers in the 17th century, probably from a variation of "Jan Kaas" (John Cheese) or "Janke" (little Johnny).
"Jerry" comes from WWI, and might come from a variation on "German" plus the slang for a chamber-pot (ie. similar to the German helmets).
"Tommy" is from the sample name on British army forms, "Thomas Atkins" (much like the modern "John/Jane Citizen" shown on sample credit cards). This practice goes back to the early 19th century.