Added support for Twig_SimpleFunctions and added handling for exceptions