improve gml read/write facilities for zen

Derek -- looks like I can't commit directly to the public zen.  I've merged the latest from the master branch of your repo into mine, so if you now merge this into yours it should be a clean fast-forward.