added debug option
changed all console.log calls to Tools.log
added Tools.log debug function