JSON serialisation of a thread's sample tree.
Missing file from previous commit.