Move error defs into seperate header file

Move the errors into a seperate file so they can be shared with
other source files
Add commands to a queue

We want the commands to be queued when they are recieved. I have
created a queue that can hold 10 commands.