HPCC-12290 Reimplement jarray using templates

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
With the second version all the same functions are used, but where I split them into two - one to cast the parameters to the correct format, and one to actually do the compare I retained that split.