[compiler] Added support for hooks before and after functions The function callbacks can be used to generate helper code that will not actually be inside the function body and similar tasks.