Add tests for clearing cache after success/failure/exception.
Restore stderr and stdout in every case to fix 'silent failure'.
Merge branch 'cache_tests' into uncaught_exceptions
Fix: Domain does not handle synchronous errors if there is a try/catch somewhere around d.run(...)