Revert "Minor efficiency improvements in Datum to JSON conversion."
This broke handling of implicit vars.

This reverts commit 5b60b48840166cb8088a5c731ddb5e2b6b14832a.