Added factory for Bjyprofiler to avoid closures in the configuration.

Similar to zf2 factories