Added support for custom template globals.