Update tutorial.

- Fix a couple of typos
- Use open() built-in instead of file()
- Update (for) and (with) examples
Merge master onto pr/486