apisocket: make classes inherit from object

In Python 2 it is recommended to inherit from object, and the defined
class is different if not doing so.  In Python 3 this was fixed.
Send pause/resume notifications from the window manager to the web activity

In the shell model for the activity: listen to changes in the state of
the Wnck window and emit custom signals "pause" or "resume"
accordingly.

In the websocket API: connect to the model signals and send
notifications to the web activity.  It follows the JSON-RPC protocol:
a notification is similar to a request except for the id, which is not
needed.
Allow the web activity to finalize sending a stop notification

Add a stop method to the shell model Activity.  It emits a stop signal
for the Apisocket to handle it.  If no callback was connected or the
callback doesn't return True, it closes the window.  So non-web
activities continue behaving as before.

Apisocket sends a stop notification to the web activity.  The web
activity must send back a close request for Apisocket to close the
window, thus completing the finalization.