Updated UI to handle various application lifecycle states properly.
Data from UI no longer lost on orientation change.