codec: fix encode/decode struct to array. Other misc fixes.

- Use pointers now that size of structFieldInfos has grown.
- Use unsorted field names consistently.
- Fix up test initialization

Update #13 .