[add] jsonAsArray flag, to enable json serialization as plain data array

Adds option to serialize data to json as plain array
Similar to #61, but do not mess with internal data structures and affects only json serialization

Changes do not affect the default behavior, but as far as I can see, the json is mostly purposed for client-server communications, and majority of client side libraries expect to receive an array of data not a map, so it may have sense to serialize data as json array by default.