Refactoring and adding "GetContext" operation 

* Adding generalized queueprocessing interface.
@superpan