Refactor message demuxing to communication layer

This will allow me to treat acks in a special way at the communication
layer.