function createClassExtender(name, doExtend) {
  const cache = new WeakMap()
  return function(classToExtend) {
    let extended = cache.get(classToExtend)
    if (!extended) { //bidir check due to inheritance of statics
      extended = doExtend(classToExtend)
      cache.set(classToExtend, extended)
    }
    return extended
  }
}
Utility for the "extend-as" pattern used in several places to decorate facade
classes with extra capabilities.
@param {string} name - unique identifier for this class extension
@param {function} doExtend - the function that creates the actual class extension,
       this is passed the base class and will only be called once per base class.
@return {function(class): class}