fixed const issue for TuplePool::query(), and added new functions to TuplePool