Allow passing block to code and demo

This will get passed the resulting app so you can do things like wire up
additional closing commands on an app without having to modify it's source
directly.
So yeah I'd be in favor of keeping the "default quit" method as it seems good to me :)