Added some support for controlling where the backbutton will lead.
merge