formatter: extract function that encode values to json string
This is the stub for tuple support, which will be used to encode ctx.date()
in the same manner as jsonchangeset printer.
Testing that hghave does not crash when checking features $ "$TESTDIR/hghave" --test-features 2>/dev/null