Improve performance of insert and delete.

* If element to be inserted is already present, return this.
* If element to delete is not present, return this.