Added rudimentary event handling

Added an event queue, and implemented Context::poll() and Context::release(const Event*).   This allows OSX examples to close in response to application Quit, or window closure.