Refactored twig extension registration to compiler pass