Add helpers for connect_after signal connection

Add some helpers (of the form "afterButtonPressed", etc.) for connecting
callbacks to signals in such a way that they are run after the default
handler completes.

Beautify some of the generated signal handling code along the way.