Added (trivial) conversion to JSON (depends on JSON.stringify)