Added simple JSON-style array of scalars decoding.
Fixed encoding empty arrays