Fixed crash due to missing window variable. Added esc to quit.
Added include files, replaced magic numbers.