HPCC-9600 Use library classes for exists and count

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>