setCurrentLayerPosition (newpos) {
    const layerCount = this.getNumLayers()
    if (!this.current_layer || newpos < 0 || newpos >= layerCount) {
      return null
    }

    const oldpos = this.indexCurrentLayer()
    if (oldpos === -1 || oldpos === newpos) {
      return null
    }

    // if our new position is below us, we need to insert before the node after newpos
    const currentGroup = this.current_layer.getGroup()
    const oldNextSibling = currentGroup.nextSibling

    let refGroup = null
    if (newpos > oldpos) {
      if (newpos < layerCount - 1) {
        refGroup = this.all_layers[newpos + 1].getGroup()
      }
      // if our new position is above us, we need to insert before the node at newpos
    } else {
      refGroup = this.all_layers[newpos].getGroup()
    }
    this.svgElem_.insertBefore(currentGroup, refGroup) // Ok to replace with `refGroup.before(currentGroup);`?

    this.identifyLayers()
    this.setCurrentLayer(this.getLayerName(newpos))

    return {
      currentGroup,
      oldNextSibling
    }
  }
Set the current layer's position.
@param {Integer} newpos - The zero-based index of the new position of the layer. Range should be 0 to layers-1
@returns {{title: SVGGElement, previousName: string}|null} If the name was changed, returns {title:SVGGElement, previousName:string}; otherwise null.