New Twig functions; ClosureMiddleware improved