Support for TileStache's 'portable' layout

This adds support for [TileStache's 'portable' directory layout](http://tilestache.org/doc/#caches) by using a URL similar to `file:///tmp/foo?safe=true`.

This also corrects grid filenames (to `*.json`) when writing.