Bug 832240 - Fix GaiaApps.runningApps

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