Initial refactor to support batch queries
Added test for batch requests
Added support for batch queries