Add deletion of data instances; clean up some mutexes and range queries