More refactoring. Changed lifecycle callbacks to :node/on-attached and :node/on-detaching.