Major changes to App.xaml.cs

The following changes need to be tested
OnStartup(...)
SingleInstanceCallback(...)

Mainly changed [If] statements