Window code cleaned
Basic graphics and some primitive error handling