Fixes coding style and import errors

The committed files should now pass pylint checks
(block-local disabled pylint error codes are written as comments)
TODOs are added when needed.