Add the ability to use a custom class for a Producer

(backward compatible)

Thanks!