MRG: testing / fixing doctest failures in pyx files

Add script to manually doctest the extension modules.

This shows quite a few errors.

It would be good to work out running doctests in extension modules via our default nose testing, but I'm not sure how to do that yet.

Here I tried to fix all the doctest errors, but I didn't know whether all my fixes (that I got from the output) were correct - can y'all please check?