Improve some comments and perform some PEP8 cleanups
Use a variable to reduce several lines length in import
Add custom error messages in import

This should allow to know what went wrong after an import failure.