Fix errors when rearranging properties in model classes

Ensure that the order of properties in the object schema matches the order of
columns, as the validation code for setting link properties assumes that they
match.

Closes #1003.
Merge pull request #1011 from realm/tg-prop-reorder

Fix errors when rearranging properties in model classes