Added an events system

Now you can close the window! Yay