Fixed a whole bunch of minor stuff. Had a go at getting some of the plethora of broken tests to pass.
Sync with Revision 519 of Instiki trunk (2007/5/7).