For a little bit of recreational programming, I came up with an eval-free method to find out the parent of a removed layer from the change-object in onDocumentChanged
:
let parent = change.fullPath().split('.').slice(0, -1).reduce(
(acc, cur) => acc[cur.match(/\w*/)[0]][cur.match(/\d+/)[0]], document)
Not sure if better