HPCC-9600 Use library classes for exists and count

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #4598 from ghalliday/issue9600

HPCC-9600 Use library classes for exists and count

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>