cleanup and performance improvements

* when reloading the main screen buttons, reuing existing views/layouts...
* cache the main buttons (load only once from db)
* code cleanup
* reactivated restart on uncaught exception