Consistent data structures for javascript