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.

I think this will allocate and throw away the format string even when debugging is turned off, hurting layout performance a lot. You may want to macro-ify this so that it doesn't allocate if debugging is turned off, similar to the way `debug!` works.