Changed registering twig extensions to be compatible with Twig 1.12.