fix for files with utf-8 encoding
Set encoding based on preferred encoding
kwargs added to File class's ctor
file mode removed from kwargs

the caller shouldn't be able to change the file mode.
Merge remote-tracking branch 'scarysandwich/utf8-fix' into dev, fixed #3