HPCC-12290 Reimplement jarray using templates

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
I can't make it private because some of the functions that need to be instantiated - e.g., sort.  I'll just kill the comment.