Replace codecs.open with io.open

This is a better solution.  In Python 3, io.open is open, and
in Python 2, io.open is a backport.  The Python 3 io.open is
more powerful, and unicode-aware.

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
missed a few instances

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
cannot do (w|r)b with io.open

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
missed some in tests

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
append?!

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
unicode literals

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
json.dump

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
no encoding

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
leftovers

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
change mock

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
missed some subdirs

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
leftover mock

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
flake8 -- stray io import

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Merge pull request #1378 from getnikola/replace-codecs-with-io

Replace codecs.open with io.open