Fixes #133

Replace “log” in response with “phases” containing an array of objects,
one for each phase, with the result tree rendered into JSON objects in
a simple, fairly human-readable way.

When an error occurs, the response body now contains JSON with “error”
and “phases” as above