Add 'references' support between object types

This PR adds support to allow references to one object type in another. This initial work adds security groups in instances and re-works the security group references to other security groups.