Add main class attribute and make sure to exit on closing of the applet frame