update imports python3 compatible

- absolute imports
- expand wildcard imports
- fix some unresolved imports
- fix imports duplicates
- remove unused imports
- remove deprecated cgi.parse_qsl dependency
- extract python3 related imports to utils module
- optimize some imports code style