Performance improvement by removing temporary objects
Minore code style fixes
Add support for exiting formspec by doubleclicking outside