Made a working topdown. Fast, but terrible performance on all except test0. I'm going to try merging topdown and bottomup next.