Convert 'print ...' statements to use Python's logging module

Details in the commit messages.

I haven't been able to run the unit tests myself, since I don't have a
figshare account ;).