What was the purpose of the test of the sticks?
Rashi (on Pasuk 25), Ramban #1 (on Pasuk 6, citing Ibn Ezra) and Rashbam: To prove that Hashem had chosen the Kohanim to serve in the Mishkan. 1
Since Levi too had a stick, how come there were only twelve sticks?
Ramban: Because Yosef was counted as one tribe. 1
Ramban: Since Yisrael are always counted as twelve tribes
What exactly, was written on each stick?
Ramban #1 (citing some commentaries): The name of the tribe was written on each stick