Changes to be compatible with Birch.

Fixed some bugs (in a bit of a hackish way) around the previous port
to Birch. Dependencies, which used to have "targets" and "types", had
been changed to edges in the Birch model, which had no notion of
target or type. Hacked together a solution to some errors around that.