WIP: GC all acitive and writing states when deleting objects

#512 

The purpose of this pull request is for review and correct design/implementation.
So !!DO NOT MERGE!!