Issue 227 login backout

This appears to be working, though the binding to the backbutton is ineffective on Android devices due to a bug described in #369. This still requires some UI work to provide a button on the wait dialog, for use in iOS (and maybe, at least until we resolve the backbutton bug, on Android as well), but that can be a separate step - the infrastructure seems to be sound.