Make Mercurial's man page and HTML help group commands by category, and
present the categories in a helpful order. hg help already does this;
this patch uses the same metadata.
This patch uses the same header level for command categories and for
commands. A subsequent patch will push the command headers down one
level.
Looks like just want h and cmdtable from the outer scope. They are available without this trick, so you can just delete the two arguments here.