JavaScript object to parse data into fields and rows