l3doc: add text markup to documentation and slightly re-arrange some internal code

frank has asked me to start looking at this class again...

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