misc sftp changes

Modified to only use a single sftp session and to use Error instances instead of strings for errors.