with_mock() function

As discussed in #159. Interface as suggested by @hadley, supports nesting, mocking more than one function, not mocking at all, and returning a value.

Early draft, with tests and a documentation stub. Comments are welcome.

Closes #163.
I'm not sure. The functionality in both loops is to different. Also, I want to call `on.exit` *before* starting the mocking, to have a security net in case anything goes wrong. However, I have extracted two functions `set_mock` and `reset_mock`, the code looks much cleaner now.