Run hooks when messages are validated
This patch allows clients to respond to messages reliably. Like the hooks for adding/removing contacts/identities, these hooks may be run more than once - that will be fixed when we have client-layer transactions.