Corretly initialize all user scripts for the application window

Signed-off-by: Simon Busch <morphis@gravedo.de>
When all windows are closed quit the process

Signed-off-by: Simon Busch <morphis@gravedo.de>