I've implemented support for pluggable URL factories.
It should be a fairly low impact change, as the default is to use the
current behavior.
Should I post a patch here for review before committing?
In short, there is now an XWikiURLFactoryService (also pluggable)
which is responsible for creating the XWikiUrlFactory for the given
mode (XWikiContext.getMode()) . I made XWikiURLFactoryService
pluggable as well to allow one to allow one to create the url
factories however desired, but its default implementation copies the
way they are current constructed.
Matt