Unicode and PEP-8/whitespace fixes.

The main change here is the removal of  which uses buffer on
unicode types. Instead, we now iterate over 32768 code points and encode them
to utf-8 individually before writing to file.

This change also addresses a number of unsafe uses of mutable method
parameters, whitespace and general PEP-8 warnings.
Fix open file leaks.

This fixes a number of instances where files were being opened without the
 statement and without a try/finally to close them.
Fix the open file leak fix.
Merge branch 'erikvanzijst-unicode' into gmv-1.8.2
remove encoding in UTF-8 of email content