Changing rows format to preserve column order

The new format is {fields: ['col1', 'col2', 'col3'], rows: [{col1: ...}, ...]}
The new fields property is needed since JSON does not preserve attribute order in objects.