Added demo code that reads from stdin

Show how one can read from stdin to utilize the pipe command of the
bash shell
Source code re structured

Part of the program that shows the did now is not a part of the 'main'
function anymore. Now it is it's own function called 'did'. This will
allow to implement OS functionality like pipes ore easily.