add initial skeleton of a message queue
add methods to queue and dequeue messages
add support to build in debug mode
add support for multi-threading to the message queue

- create new method that will dequeue a new mesage but will block
  if there's no mesage in the queue.
- use conditional variable to signal when there are new messages in the
  queue.
- other small fixes and improvements.
use the message queue in the state machine

- dequeue messages (which contain the next state) from the queue and
  block if there's no new message/state.
- create new method used to set the new state where to transit (which
  will queue a new message with the new state).
- create new method used to request the state machine to finish the
  execution.
update main with testing the new state machine