Adopting JSON module from CCAN for escaping JSON strings and outputting numbers.