[ticket/12775] Add a container_factory class and remove functions_container

https://tracker.phpbb.com/browse/PHPBB3-12775
https://tracker.phpbb.com/browse/PHPBB3-12420
https://tracker.phpbb.com/browse/PHPBB3-12774
(Useful for https://tracker.phpbb.com/browse/PHPBB3-12685)

PHPBB3-12775
What is the difference between this and https://github.com/phpbb/phpbb/pull/2671/files#diff-6a108beaf3a67c9e6529b344224911c8R149 ?