Yet another ES6 Map/Set implementation which avoids linear search when possible