Added relation reference constraints for unit testing
Refactored relation tests
Merge remote-tracking branch 'origin/master'