Fixed queue bug when handling a lot of commands. Added test case for timeout. Added benchmark code