Helper to dump CouchDB _design document into filesystem It tries to do same things as couchapp does if it can