Move rootScope utilities from main.js to AppCtrl.js