Add a few unit tests on RelationType.
Implement proper type-checking of relation literals.