Improved the derivation of the xmg:pathroot and xmg:path variables. Added some documentation of the parameters passed to the defaults.xsl XSLT.
Reworked menu handling to better split between the logic of generating its full structure, and the displaying of that structure in various forms.