Pure function that updates the model based on a message.
The new state after processing the message
The current state
The message to process