PHP 5.3 compatibility in plugin configuration

Moved context.load_factories listener to separate method, as $this cannot be used in lambdas in PHP 5.3