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.

This is directed to the master-ios-integration-branch. After it is merged there, we should probably make a distinct branch of the master for conducting out-of-the-mainstream CS work, and merge the integration branch to the master, since most of our ongoing work belongs here/there.