Fix couchjs utf8 conversions (#2786)

* Remove unused string conversion functions
* Set UTF-8 encoding when compiling scripts
* Encode JavaScript strings as UTF-8 for printing
* Check that only strings are passed to print
* Use builtin UTF-8 conversions in http.cpp
* Add tests for couchjs UTF-8 support
* Remove custom UTF-8 conversion functions

We're now using 100% built-in functionality of SpiderMonkey to handle
all UTF-8 conversions.

* Report error messages at global scope

Previously we weren't reporting any uncaught exceptions or compilation
errors. This changes that to print any compilation errors or any
uncaught exceptions with stack traces.

The previous implementation of `couch_error` was attempting to call
`String.replace` on the `stack` member string of the thrown exception.
This likely never worked and attempting to fix I was unable to properly
invoke the `String.replace` function. This changes the implementation to
use the builtin stack formatting method instead.

* Modernize sources to minimize changes for 68

These are a handful of changes that modernize various aspects of the
couchjs 60 source files. Behaviorally they're all benign but will
shorten the diff required for adding support for SpiderMonkey 68.

Co-authored-by: Joan Touzet <wohali@apache.org>
7 files changed