Move IMessage interface to interfaces module

Also fix some misc flake8 errors.
Fix arguments of logging in import_messages.