The ligo.gracedb.rest module should raise exceptions instead of calling sys.exit() so that it is possible to inspect stack traces. Generally, methods in importable modules should not call sys.exit(), just as C library functions should not call exit().
This change turns output_and_die into a class method that can be overridden in the classes in the ligo.gracedb.cli module. However, ideally we should get rid of the output_and_die method altogether, raise ordinary exceptions in ligo.gracedb.rest, and handle user-friendly rendering of errro messages in ligo.gracedb.cli.