Add a docopt-based test.r function in examples/