[WIP][ticket/11649] Move construction of twig environment to DIC

This is WIP because it slows down the tests a lot. Need to investigate dumping the container for the test suite. Or possibly other approaches to avoid using the container in tests.

[PHPBB3-11649](http://tracker.phpbb.com/browse/PHPBB3-11651)