fixing up a bug in get_couch.  more to come likely

the problem is switching from big block of code to smaller
functions...slowly eliminating globals, converting to proper idempotent
functions