Rework toJSON to be conformant with JSON package.

We had methods named toJSON that were async. This interferred with
the workings of JSON.stringify. In the course of fixing this problem
it became clear that we could remove a significant amount of code
that essentially duplicated portions of JSON.stringify.
Merge pull request #25 from jimlloyd/chore/Conformant-toJSON_83890480_r2

[Finishes #83890480] Rework toJSON to be conformant with JSON package.