Specify encoding for reading notebook file.

Closes gh-4562
Specify encoding in remainining instances of io.open
Merge pull request #4563 from takluyver/i4562

Specify encoding for reading notebook file. and a few other calls to io.open with missing encoding