Allow handlers to return metadata

Add a configuration type for functions like SetSourceMessageId