Started implementation of message decoding and encoding