Update couchdb-dump.sh

many bug fixed. 
Basically everything is done with the very powerful 'sed' unix command (see line 69)