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

I would r+ a patch that got rid of `app` so fast...