refactor preamble generation

This changes how the Latex preamble is added to the document. Instead of
doing it sequentially and thus writing the preamble right in
document_start(), it is kept in the storage helper and only written at
the very end. The advantage is that syntax plugins can influence the
preamble later on and still have everything in the right order at the
end.

A few more changes are in this commit:

  * utf8x input encoding is now always used and setup in the preamble
    instead of having it in the config. Since DokuWiki always uses
    UTF-8, I don't see why this should be configurable
  * The Latex escape function is moved to the helper class and made
    static for easier reuse in other components of the plugin
  * Packages now have one function to easily print themselves
  * some whitespace padding changes