Bond connection and reference counting

 Updates the interface to the capability server to use newly implemented capability server features.

- bond between app manager and capability server: If the connection is broken, the capability server will automatically stop the capabilities used by the app manager

- reference counting: the capability server now keeps track of how is using the same capability and will shut them down after the last user is gone.

This resolves #114 and also fixes #126.