Moved exit_with_result() and exit_with_error() into Session as static functions.