Transforming json string to byte-sequence preserving sort-order.

collate json
------------

  Collating json normally means comparing two json string to get sort order.
  In our context collating json means tranforming json string into
  byte-sequence preserving the sort order.

Benchmark with dparval
----------------------

The sample json string used for the benchmarks contain about 5 properties
with a mix of bool, float, null and array as property-values.

benchmark for dparval.NewValueFromBytes(json) and doc.Value() APIs
    Benchmark_DParVal         500000              6140 ns/op

and following benchmark is using CollateJSON API from `tugtng`. The benchmark
tries to simulate key comparision while walking through the btree,
    BenchmarkTuqCollate       200000              9959 ns/op

Benchmarks for byte-sequencing json string
------------------------------------------

Encoding json string to byte sequence and comparing:
    BenchmarkEncode   100000             20728 ns/op
    BenchmarkCompare  10000000             157 ns/op

complex part of BechmarkEncode involves encoding integer and float

    Encoding/Decoding integer:
        Benchmark_encodeInt      2000000               975 ns/op
        Benchmark_decodeInt      5000000               640 ns/op

    Encoding/Decoding small-decimal: (-1.0 < number < 1.0)
        Benchmark_encodeSD       2000000               778 ns/op
        Benchmark_decodeSD       5000000               474 ns/op

    Encoding/Decoding large-decimal:
        Benchmark_encodeLD       1000000              2050 ns/op
        Benchmark_decodeLD       1000000              1184 ns/op

I also tried parsing JSON string using parsec (parser combinator) tool, which
ended up being 10-20 times slower when compared with dparval, gojson and
gojson-pointer. May be I am doing it wrong, if some one is interested in
parsec tool, please refer to `parse.go`.

Memory foot print for input and output
--------------------------------------

Ran json encoding on 1 million random json documents,

    average input text size: 97
    average output byte size: 81

Please refer TODO file for known issues.