isArray, toJSON and sum are now available in JS (closes #4)