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.

Now also contains #161.
Can you please add `add = TRUE` here (best practice so if you add another `on.exit()` in the future, it doesn't get clobbered)