API for creating dynamic mocks for arbitrary functions.