Complete the JSON Encoder for Trace, UsageData and relevant test cases