function setElId (el, parentId) {
  let elId = shortid.generate()
  if (parentId) elId = parentId.concat('.', elId)

  let newElement = {...el, id: elId, children: []}

  if (el.children && el.children.length > 0) {
    for (let childEl of el.children) {
      newElement.children.push(setElId(childEl, elId))
    }
  }
  return newElement
}
Assigns a new id to the element preceded by the parentId and a dot '.'

@param {object} el : Element to register
@param {string} [parentId] : Id of the parent element

@return {object} : New element (cloned from egglement) with newly assigned ids