Setup logger before scimm

This is a quick hack to make sure we import and setup logging before we import
root, and thus scimm. This fixes a bug where logging messages from the scimm
thread never made it out.
Explicitly use UTF-8 for opening files