Initial implementation of command queue
Added common error management