NF: add tool for doctest for extensions

Fetched from the dipy/tools directory.