Update to read and write files using Unicode UTF-8 encoding

This fixes issue #5