Bug 1027232 - Restart b2g at each app. Wait for the homescreen to be ready

I think this whole function should be a single line of [simpler] code