Tweak dbg

Clean up debug IO channel and stdio channel. By the way, debug IO channel is abstracted as debug_device, which reserve the flexibility to use RAM or other devices as output port.