Add new MathHook

* Adds a new hook that is called after the rendering
  this is required to keep the MathIndex up to date
  for the MathSearch extension.
* The hook can be used for special modifications of
  the output format.

Change-Id: I7b45b4398c10ffe75f481a82c149ba4f66820338