Regarding the mathwiki code: it is indeed GPL'd, but you have to request it by email from Serge Winitzki who currently maintains it.
I have a copy of the code and I can send it to anyone who's interested. It's perl. The code is a bit rough still and you have to experiment to get it to work, but it does work.
It has a ParseTeX.pm perl module which we can probably reuse.
A life example is running at http://www.mathcircle.org/cgi-bin/mathwiki.pl
Axel
wikipedia-l@lists.wikimedia.org