Improvements: Added the unregisterWindowController call, as well as code to close the window when the plug-in unloads, as good practice mandates.