Better record handling.

Doesn't yet support nested records.