-[PANEL] Main function handles app event registration automatically.
-[PANEL] Added "close" app event
-[PANEL] Document and layer selection are checked when a document is closed