Fix Close Function, Manage Panel Correctly

- Fixes #50

Ensures that the Panel is cleaned up (when requested) and that we do not create new Panels indefinitely.