Update style of flow and remove its reliance on `tree` …
`tree` is an old API that predates the use of traits. It should be redone. This commit breaks the dependency on it.