Performance improvements by removing temporary objects.
Minor code style fixes
Add support for exiting formspecs by doubleclicking outside