HPCC-12290 Reimplement jarray using templates

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
No.  In some ways I quite like having the version that does the work, and the version that casts the parameters to the correct type though.