Add status handling to couch sync service

This adds a status to the couch sync service. Status can be "sync", "online", "offline". The status can be observed using sync.onStatusChange().

The idea is to reduce the number of pouchdb event handler registrations throughout the application. This can also be used by controllers to know when they can fetch data using the views. Maybe a sync.ready() method should be used (which is called when status moves to "online").
In sl-calls I am cleaning all callback arrays on logout, otherwise when the controller is called again, replicated callbacks are added.  Maybe something to do here too?