Make the reduced functional class more robust against overloading.

A user overloaded ReducedFunctinonal implementation might not have a cache attribute.
This commit adds a check that the cache attribute exists before trying to access it.
Support parameters that have a "copy" function.