Extract custom globals, functions and filters into twig extension class.