Improved exception handling in couch module (#7486)

The return values of all of these functions should be changed, and
errors should be indicated by exception classes in the couch module.
The return codes are not system exit values and they don't have
anything to do with array or string indices, so they should not be
0 for success, -1 for failure.

With errors indicated by exceptions, we could more conveniently pass
richer information about the error, which could then more easily be
inserted into the dashboard document.  This will be more important down
the line when we're talking about further automating the ingestions,
since we'll need errors to be reported through a web interface that has
access to the dashboard document.