Add deep copy interface.
Handle trash_stack when inserting objects.

Free old trash_stack when inserting a key to an object, since new
key might differ from the stored one.