reafactor common methods into QueueClient

split queue manipulation functionality into QueueClient class, used by both SchedulerMiddleware and QueueMiddleware