Based on RFC 3501 and original imaplib module.

This is a version of imaplib that uses threads to allow full use of
the IMAP4 concurrency features, and to de-couple a user of imaplib
from i/o lags, except where explicitly allowed.
