Add an initial pass at a layout debug module.

This outputs a trace of the layout process to a JSON file which can be viewed in an external tool. It provides a timelapse view of how the flow tree and fragments changed during the layout process, which makes
it easier to debug layout bugs.