Fix several issues found by pylint

Includes fixes for:
- bad indentation
- wrong continued indentation
- old-style-class
- bad and trailing whitespaces
- import only what's needed
- unused imports
- unused variables
- superfluous-parens
- multiple-statements in one line
- too long lines

Also included:
- use UNIX instead of Windows line endings
- add .gitignore
why is this needed?