fix imports
fix string/bytes issues
fix iterator issues
fix whitespace and styling
fix stream implementation
move scripts directory