Added subscribe to object update

Added code to subscribe to updates of the context object.
Also resolved some JSLint warnings.