BF: refactor scripts to run in Python 3

Moving towards common code-base
RF: work around abscence of .name for bz2file

Python 3 bz2file does not have a '.name' attribute.  Store the filename
from the opener class to fill in this value if possible.
Merge pull request #170 from matthew-brett/py3-script-fixes

BF: refactor scripts to run in Python 3

Moving towards common code-base

See errors at : https://travis-ci.org/matthew-brett/nibabel/jobs/6037076