Add support for <maction actiontype=knowl>.  Refactor code to allow it to be reused between the TeX and MathML implementations.