Integrating command queue into event loop.
Adding actual deallocating of the object into destructor.