libfoundation: Add MCRecordEncodeAsArray() and MCRecordDecodeFromArray().
libfoundation: Validate field name list when creating MCRecordTypeInfo.

The field names need to be caselessly distinct!
Merge pull request #1519 from peter-b/misc-records

libfoundation: Further work on records API.