Introduce reference tracking in Cache

Any links to a record will be stored on that record's `refs` property, keyed by the full path of the link.

These references are automatically tracked in the Cache as records and links are added and removed.