Fix idg to handle ^C and ^D

* Add trap to class
* idg now handles ^D by exiting
* idg now traps ^C and exits
* Add trap example