And:
- Use a different port for tests so server tests don't break when Zotero
is already running
- Remove no-op httpServer.enabled pref updates in tests
- It's already enabled, no test disables it, and any test that did
would clean up after itself
- Updating that pref has no effect without a separate call to
Zotero.Server.init()
- Remove unused arg to Zotero.Server.init()
An endpoint can now take a single object containing 'method', 'pathname',
'query', 'headers', and 'data' and return an integer, an array containing
[statusCode, contentType, body], or a promise for either. This allows the
handlers to use the HTTP method and headers and removes the need for callbacks
when some handlers already use coroutine().
If init() returns a promise, it now has to use the new single-parameter
signature (because the check is done with Function.length, and combining
promises and callbacks doesn't make sense anyway).