Bug 1042939 - Resurrect periodic sync, alarms refactor r=millermedeiros

I would really like to see the `app` namespace go away in the future.. we are only using it here to get references to singletons. (don't need to update it on this patch, just a comment about what usually happens on our code)