Add even more unit tests for the API

This patch replaces most of the remaining TODOs in test/unit/api_spec.js with actual tests.
Merge pull request #5174 from Snuffleupagus/even-more-api-unittests

Add even more unit tests for the API
Avoid an allocation in readCharCode().

readCharCode() returns two values, and currently allocates a length-2
array on every call to do so. This change makes it instead us a
passed-in object which can be reused.

This tiny change reduces the total JS allocations done for the document
in Mozilla bug 992125 by 4.2%.
Merge pull request #5172 from nnethercote/readCharCode-retval

Avoid an allocation in readCharCode().
Remove two instances of leftover console.log debug statements

The `console.log` statement in evaluator_spec.js is obviously not needed. In obj.js it could have been replaced by `info`, but that seemed unnecessary given the already existing `error`.
Merge pull request #5177 from Snuffleupagus/remove-debug-console-log

Remove two instances of leftover console.log debug statements