A new helper for tests: createHierarchyRenderer

We aren't using this in any of the React tests, but we've found it
useful testing product code.