Use ProfilingAdapterFactory instead of closure in module config

I saw that you merged #32.

It would be nice to remove now the closure from the config file (and be able to use config cache).