Allow replacements to be specified in with-stub.

Useful when unit-testing integration points, where the function needs to return a value for the code being tested to continue, but calling the function is undesirable because of side-effects.