Major changes to comply with the activity lifecycle. Doesn't die on
rotating now.