Move _function_wrapper up to Sampler class

Should it be in the base class? It saves time when one is subclassing ``Sampler``.