The code is broken, committing as a  a checkpoint
Split window implementation into window.go.