Make use of the fact that 'elem.dataset' is a map, and just remove the item instead of inserting strings with special meanings. Also add some asserts for {clear,get,set}Index() methods.