Add template_global decorator

Adds a decorator to allow developer to register global functions.