Bug 1023950 - Implement real state handling for mozApps and apply visuals

https://bugzilla.mozilla.org/show_bug.cgi?id=1023950

Real PR: https://github.com/mozilla-b2g/gaia/pull/20840