Backported statestack from other repository, minor titlestate changes.