email: Alphabetize imports (swap email.mime and email.header)

Signed-off-by: W. Trevor King <wking@tremily.us>
email: Use Charsets to set the Content-Transfer-Encoding

This ensures that payload encoding/decoding happens appropriately, and
allows 7-bit-clean data to be sent with a 7bit CTE, even when the
use-8bit setting is on.

Signed-off-by: W. Trevor King <wking@tremily.us>
email: Factor message-to-bytes formatting out into _flatten()

Signed-off-by: W. Trevor King <wking@tremily.us>
email: Add a failing UTF-16 _flatten example

Signed-off-by: W. Trevor King <wking@tremily.us>
email: Fix _flatten() implementation for non-ASCII bodies

The email header should be flattened to ASCII with funky encoded
headers [1], but the body may be encoded in a non-ASCII-compatible
charset (e.g. UTF-16-LE).  The old _flatten() implementation used the
body charset to encode the entire message, which could garble the
header.  This patch uses BytesGenerator, which takes advantage of
email.charset.Charset's separate fields for the header encoding and
body encoding.

[1]: http://docs.python.org/3/library/email.header.html

Signed-off-by: W. Trevor King <wking@tremily.us>
email: Encode the body when we might use 8bit encoding

R. David Murray writes [1]:
> In 2.x that will work, and will give you the 8bit CTE at need, as
> long as you pass encoded text to MIMEText (as opposed to
> unicode...which it doesn't really handle correctly if I recall
> right).

See also, [2].

[1]: http://bugs.python.org/issue12552
     email.MIMEText overide BASE64 for utf8 charset
[2]: http://bugs.python.org/issue12553
     Add support for using a default CTE of '8bit' to MIMEText

Signed-off-by: W. Trevor King <wking@tremily.us>
config: Fix 'significan' -> 'significant' typo in a comment