Add docstrings to check_functions and test_octave; consolidate the script parts.

There is also an improvement to test_octave, to handle the case where all nans are returned, and to show the differences when the test tolerance is exceeded.  In the one case of the latter, it is only 1e-12.  We could open up the rtol parameter from its present value of 1e-15.