XUIApplicationMain added

Signed-off-by: Felix Gabel <felix.gabel@me.com>
State restoration added

Signed-off-by: Felix Gabel <felix.gabel@me.com>