Modify Message and Command structs.

Also add functions for initializing and destroying message queue.