Implemented using an atomic refcount. Still haven't applied "shared" more broadly to the code yet though. It seems difficult to do that in pieces.