adds close button and makes sure panel moves with dialog.

Fixes issue #39.
@quider will be great if you can review this and let me know if it addresses your concerns in issue #39.