Workaround for Go JSON encoding incompatibility with CouchDB

Integers longer than 6 digits didn't round-trip identically on their way
into and out of documents: for example, on input 1234567, on output
1.234567e+06. This is equivalent, but CouchDB's JSON parser barfs on it
<https://issues.apache.org/jira/browse/COUCHDB-1670>.
Fixed this by adding a FixJSONNumbers function that looks through a
parsed JSON object for double64 values that are actually representable
as int64 and converting them in-place to int64.