Bug 830240 - Fix app launching problems

This fixes the infinite recursion in runningApps, as well as migrates the gaia_apps.js from bug 832240 into gaia-ui-tests.