Get port/key from the window properties

This is cleaner and will allow the python activity to
set them up for every pages, not just the first loaded one.
Adapt to sugar and sugar-toolkit changes

We now pass the activity id in the authentication.
Add an output stream

This will be used for the datastore API.
Add InputStream support

This is going to be used by datastore.