[js] toString: add tsn_itoa() utility function for converting from integers to strings