Moved Twig initialization towards the top of the script (so the script dies early if Twig hasn't been installed)