Support struct IDs

Support txns of docs with struct IDS.
In the worst case of a quicksort that'll be N^2 marshalings, for each struct!