Port to immutable tree API, part 2

Signed-off-by: Solomon Hykes <solomon@docker.com>