Read files in utf-8 via codecs module

We were encountering problems with having files read in as ASCII and
then doing str.replace calls on them with unicode values. Here we make
sure we read and write the files as utf-8 so that we're only dealing
with unicode strings rather than a mix.

I'm not very well versed in unicode so more work might be required.
Updated README with encoding information

Explaining the use of the variables.