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

https://tracker.phpbb.com/browse/PHPBB3-12775

PHPBB3-12775
for $container I agree, but for the others it make sense to me to explicitly assign them to null.