Moved constants and appsdb out of main
Exploded some code in the application, mackup and utils modules