improve error message when accessing undefined fields.
refactor away all copies of types and schema into the message struct kept by the data process.