move debug-related code into debug.js, expose as Debug global.
rebuild files.