Added a debugging capability for widgets

Now they can be run as standalone programs and they print their output to stdout and read their input from stdin as well