Group all commands by module (guessed automatically) in the index

For command names found in a macrocode environment, l3doc must find the module
automatically.  It uses simple heuristics: the module is essentially the first
word in the command name if it contains |:| or |_|; the presence of an @
signals that it is a TeX/LaTeX internal command; all others are sorted as they
were before.  Since the code is written, I've also applied it to the arguments
of |\cs|, |\cmd| (not |\tn|), and the function and macro environments.

One issue is whether to use the page number or code line in the index for the
various types of entries.  Mixing looks weird.

Also in this commit: multiple code changes either to permit the index changes
or found as I went along trying to clean up and understand the code.


git-svn-id: http://www.latex-project.org/svnroot/experimental/trunk@5310 de43f980-851b-0410-b2f7-c40aca1f87e0