added 'query_to_string' method to library class