Change removeWriter to use ID

Prevents problems when the Writer class differs between the
CacheManager and the Writer instance.