Make sftp.open handle binary and text, more type conversion
Fix some deprecation and resource warnings
Fix message to handle long properly, even on Py3
More type conversions