Add python3 compatibility
Remove unused imports