Full migration of all python scripts and libraries to python3
This MR migrates all python scripts to python3
This includes
- converting incompatible code to python3 compatible one
- updating the usage of 3rd party libraries due to changed interfaces
- adding typing to most of the code
- reformatting the code with autopep8
All code was tested manually.