HPCC-12290 Reimplement jarray using templates

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
The const version would be called when you had a const object.  So you could have a const array, and extract read only elements from in.  NOTE: The non const version allows you to modify the returned elements.

    x[3].value += othervalue;

Which is one thing our current implementation doesn't allow (which I wanted for the stats).