pylint cleanup of modules.py and required associated changes.