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