Allow preamble definition with user functions

This allows to define helper functions or macros together with a
user-defined function.