Modify debug.js to write messages to an external div.