update reference on for instance refernces
adds test for adding reference
refactor add reference test
add refernce delete test
add refernce delete cascade/nullify test