Replace codecs.open with io.open

io.open is a more modern and powerful way to do this, io.open is open on Python 3 and a backport of that on Python 2.