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

PHPBB3-12775