Extract script runner into a function.

Extracted script tunner into a function. Now this function needs to be
placed in `t/proof` where it can be used by tests.

See #171.