Initial abstraction over console window.
Basic input support.
Some refactoring.