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

Also same thing here about storing the results of boolean operations in variables in basic cases...