added callback options.

added callback options for visibility and unload events.
added onBeforeUnload

2048 needed to save state prior to exiting.
added setter.
minor getter/setter addition.
changed from containsPoint to pointInside.

I should have been overriding all along.