Code Cleanup

- PEP8 Fixes
- Lint Fixes
- Imports optimization (alphabetically sorted, grouped by type, remove unused, etc)
- "%s" changed for "{}".format()
- Encoding declarations
- No changes to logic of the code