Implement a ref counting GC