[ticket/12775] Replace functions_container with a container_builder class.

https://tracker.phpbb.com/browse/PHPBB3-12775
https://tracker.phpbb.com/browse/PHPBB3-12420
https://tracker.phpbb.com/browse/PHPBB3-12774
(Kind of required for https://tracker.phpbb.com/browse/PHPBB3-12685)

PHPBB3-12775
updated