Infrastructure for testing examples in docs
It would be great if we could test the documentation some more.
We could add a mechanism for defining unittests that execute standalone scripts in the doc/ tree. There's some discussion and pseudocode in !1740 (merged).
Once this is resolved, we can remove the duplicated parts of the unittest from !1740 (merged).