Closing of file handles in packed grammars.

..and some minor tool stuff. Fixes #109.