client
var/reference_holder
verb/test()
var/datum/test_datum = new()
reference_holder = test_datum
var/list/references = references(test_datum)
for(var/object in references)
var/variable_name = references[object]
src << "[object].[variable_name]"
Using that test verb would result in the text "/client.reference_holder" being output to the user. (An open issue here is what to do with temporary variables, such as "test_datum" in the example above.)
Using such a proc we could replace one object with another in a way which effects all places where it is referenced (effectively turning one object into another), or selectively null out references to that object. If this sort of functionality is already present on the back-end as a result of the garbage collector, that would be great. If it's not, then I'll continue to make due without.