Confucian Messianism, Mencius, etc
From 《孟子·公孙丑下》:


  孟子去齐。充虞路问曰：「夫子若有不豫色然。前日虞闻诸夫子曰： 『君子不怨天，不尤人。』」 曰：「彼一时，此一时也。五百年必有王者兴，其间必有名世者。由周而来，七百有馀岁矣。以其数则过矣；以其时考之，则可矣。夫天未欲平治天下也；如欲平治天下，当今之世，舍我其谁也？ 吾何为不豫哉！」


Mengzi was a very boastful person. I think the prophecy (actually more of a theory) 五百年必有王者兴 was something he made up to elevate himself to the savior (the One) of his time. He further talked about this prophesy of the 500 year cycle in 《孟子·尽心下》:


  由尧舜至于汤，五百有余岁，若禹、皋陶，则见而知之。若汤，则闻而知之。由汤至于文王，五百有余岁，若伊尹、 莱朱，则见而知之；若文王，则闻而知之。由文王至于孔子，五百有余岁，若太公望、散宜生，则见而知之；若孔子，则闻而知之。由孔子而来至于今，百有余岁，去圣人之世若此其未远也。近圣人之居若此其甚也，然而无有乎尔，则亦无有乎尔！


Mengzi listed the following nine sage emperors (圣王): Yao, Shun, Yu, Tang, Wen Wang, Wu Wang, Zhou Gong, Kongzi (素王) and Mengzi himself (舍我其谁).


  What is entailed in the idea of a golden age that would be inaugurated by an emperor who responds to the cosmic order by enacting the proper rituals and cultivating his personality?


I don't know the exact source(s) it is referring to, but again in 《孟子·滕文公下》:


  天下之生久矣，一治一乱。


The idea of 一治一乱 is simple: a period of peace and prosperity follows (and predates) a period of war and chaos. Whenever a new dynasty is established, the new ruler would employ theories such as 五德终始说 to claim his righteousness to reign.

Bear in mind that China had just experienced a period of war in Jingdi's (the father of Wudi) time and was constantly under threat from neighboring forces, so whatever Wudi did, the prophesy was used to solidify his power. The use of the prophesy, however, was not limited to the rulers. Sima Qian employed the 500 year theory to express his ambition in his autobiography 《太史公自序》:


  先人有言：「自周公卒 五百岁 而有孔子。孔子卒后至于今 五百岁，有能绍明世，正易传，继春秋，本诗书礼乐之际？」意在斯乎！意在斯乎！小子何敢让焉。


Notice his tone of voice was basically the same as that of Mengzi: in the present age, 500 years after Confucius (or Wen Wang before him), who else other than the Grand Historian is capable of producing something big and everlasting?

We can see the profound influence the 500 year theory had on later Chinese intellectuals in poems such as


  梅花重压帽檐偏，曳杖行歌意欲仙。後 五百年 君记取，断无人似放翁颠。


by the Song poet Lu You, or


  满眼天机转化钧，天工人巧日争新。预支 五百年 新意，到了千年又觉陈。


by the Qing poet Zhao Yi.