Implement Log object, as common framework for log messages.
Change die() to issue window.stop() instead of exception.
Switch from using console.log directly to Log calls with various verbosity levels.