Move sys::refcount to managed::refcount

More progress on #2240