Add support for trace and measures.

This is only administrative change to match the doc.

I also replace the “if it's a string, then convert it to dict first” behavior @Tpt did not like by two different methods (`from_dict` and `from_json`).