Improves console-mode handling for simple programs
Adds example program on how to handle stdin input.