Pass the dependencies to define

Rather than manually requiring. This is necessary for test/ as
explained in the documentation. It's probably not required for
the rest of the code but it feels nicer so I did it everywhere.