Rework reference handles so they are cleared on project close and removed on reference delete, and so that each project can hold its own reference to account for possible different resolved versions.

Change-Id: I386fe440f5478981ccab88f6d9f995aac3e517b1
33 files changed