Added subscribe to object update

Added code to subscribe to updates of the context object.
Also resolved some JSLint warnings.
Modern browsers support what you have described. Older browser versions depend upon 'typeof' more. Also this way you do a binary correct value check of the variable. That is why i always write it this way.

You can also do this:

callback && callback();

Eventually it is the flavor of javascript you like most. I like to write out what it is you are doing instead of shorten it down. Last thing is that the callback in some versions of Mendix was not set. And you should always check if the callback exists. Otherwise the flow of javascript is interrupted and your Mendix App breaks down.