respect needs_context and needs_environment options for twig extensions #314