Update resource usage following Connexions/cnx-epub#23

- Use `with resource.open() as f: f.read()` instead of `resource.data`