Fix Unicode and datetime.datetime serialization issues.

Fixes: bab09 (and fixes #6)

Also, formatting of Unicode variables was broken.