HPCC-8556 Refactor const char * query functions from helpers

Renamed context method to something a little clearer.
Other minor changes from code review.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>