Moved shutdown code.
Shutdown now handled by a shutdown hook, so if JFrame's custom om close method doesn't fire,
cleanup will still happen.