Fix IMAP.login() to work properly.
Also, add remote tests for imaplib (part of #4471).
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index 9b0fd3b..1b37546 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -1054,10 +1054,10 @@
 
     def _quote(self, arg):
 
-        arg = arg.replace(b'\\', b'\\\\')
-        arg = arg.replace(b'"', b'\\"')
+        arg = arg.replace('\\', '\\\\')
+        arg = arg.replace('"', '\\"')
 
-        return b'"' + arg + b'"'
+        return '"' + arg + '"'
 
 
     def _simple_command(self, name, *args):