Return object instead of array for empty format=versions request

Reported https://forums.zotero.org/discussion/41470/
Fix some issues with HTTP requests in tests

- Don't try to set Authorization twice if both API key and user/pass
- Don't send Expect header
- Consolidate HTTP request generation code