More cocoa fixes.

1. Made it possible to specify which NSView you want to use for the context. Before, it always assumed it should use the NSWindow's contentView.

2. Upon request, added Cmd+Q shortcut to quit the application.