Add jsonutil.

This is a work in progress. The plan is to make it easier to robustly
work with json data, including a kind of pattern matching to cleanly
verify type information at the start. That way we can check once and
proceed to read out the expected fields without having to type check as
we go.