first part of tutorial works in Python 3

Changed file handling in MmWriter; the file produced by the tutorial is
identical in the old version (Py2) and the new version (Py2 and 3).