Added subscribe to object update

Added code to subscribe to updates of the context object.
Also resolved some JSLint warnings.
The same situation as line 116.