Implement a function to format a dynd ndobject as JSON