Added Window class, re-structured code and added TODOs accordingly