Refactor code to use Symfony OptionResolver component
Fix problem with twig extension after refactoring