Stub, Spy and Mock for plain functions.

We'd like to stub, spy and mock plain functions. This is a just a small patch to implement the stubs, but we don't know how to implement properly the other doubles. So, it'd be really great if you add some commits to this PR or implement your solution in the mainline. Thanks David. :grinning: