Add removePeriodicSync call in shutdown()

Also add some comments explaining placement of addPeriodicSync/removePeriodicSync calls.

I think this matches what we talked about on IRC yesterday.