Added more python execution safety

Clean execution no matter what the user did wrong. Added a quit menu
entry in the tray. Rearanged the modules