Added subscribe to object update

Added code to subscribe to updates of the context object.
Also resolved some JSLint warnings.
JSLint complains that the typeof is not necessary here, because the variable can be compared against 'undefined' directly. In my own code I removed the typeof and everything works fine.

Or is this some weird cross browser issue? We use Chrome and I also test in the most recent versions of FireFox and IE.