Added subscribe to object update

Added code to subscribe to updates of the context object.
Also resolved some JSLint warnings.
I see. I checked how I did this in my widgets. I link the subscribe to call a function (loadData) that has no parameters. The update function calls loadData too.
I assume that the subscribe is only triggered when the object is changed that has been loaded before. If a different object is shown, the update function would be called, which unsubscribes and then subscribes to the new object.